I thought I'd post here just in case anyone else is attempting something similar.
I'm trying to base my position size on the equity curve.
When equity is at a new high I want take a standard (4 contracts for example) position and while in a drawdown I would like to take 1/2 the standard position. I define drawdown as anytime that the current equity is less than the highest equity for the last 4 trades.
Here is what I tried:
inputs:
start$(50000), riskPCT(1.5),riskPCT2(1);
vars: equity(0), risk$ (0),risk$2(0), risk1(0), risk2(0), NC(0), EquityLow(0);
Equity = start$+ NetProfit;
risk1=riskPCT *.01;
risk2= riskPCT2 *.01;
risk$ = Equity*risk1*.005;{risks 200 per contract)
risk$2= Equity*risk1*.005;
NC = risk$ ;
if equity [0]<highest( equity, dayz)[0] then
NC = risk$2 ;
buy("buy") nc contracts next bar at open;
The problem is I could have loss and unless the trade takes place within 4 bars I'm not technically in a drawdown according to my rules.
Any Ideas how I could track the highest equity of the last four trades rather than the equity level for the last four bars?
I'm trying to base my position size on the equity curve.
When equity is at a new high I want take a standard (4 contracts for example) position and while in a drawdown I would like to take 1/2 the standard position. I define drawdown as anytime that the current equity is less than the highest equity for the last 4 trades.
Here is what I tried:
inputs:
start$(50000), riskPCT(1.5),riskPCT2(1);
vars: equity(0), risk$ (0),risk$2(0), risk1(0), risk2(0), NC(0), EquityLow(0);
Equity = start$+ NetProfit;
risk1=riskPCT *.01;
risk2= riskPCT2 *.01;
risk$ = Equity*risk1*.005;{risks 200 per contract)
risk$2= Equity*risk1*.005;
NC = risk$ ;
if equity [0]<highest( equity, dayz)[0] then
NC = risk$2 ;
buy("buy") nc contracts next bar at open;
The problem is I could have loss and unless the trade takes place within 4 bars I'm not technically in a drawdown according to my rules.
Any Ideas how I could track the highest equity of the last four trades rather than the equity level for the last four bars?