I have no further solutions.
LinkParticipant
Senior
//Condiciones de posicion
CONDBUY = CondBuy1 and CondBuy2 and c1 and c2 and c3 and CtimeA and Tradeon and TradeON1 and TradeON2 and TradeON3 and Not Onmarket
ONCE equitycurve = 0
curveperiod = 17280
once mydays = 1
once olddate = 0
//indicators
equitycurve = average[curveperiod](strategyprofit)
ONCE TradeON3 = 1
IF StrategyProfit CROSSES UNDER equitycurve THEN
TradeON3 = 0
ENDIF
IF StrategyProfit CROSSES OVER equitycurve THEN
TradeON3 = 1
ENDIF
//mydays variable incrementing to let the average curve build over time
if date > olddate then
mydays=mydays+1
olddate = date
endif
GRAPH equitycurve coloured(255,0,0) as "equity curve"
GRAPH strategyprofit as "strategy profit"
//Tamaño, Profit y Stop de la posicion
IF CONDBUY and Strategyprofit <= 80000 AND mydays<curveperiod THEN
ONCE Positionsize = 1
buy positionsize contract at market
SET TARGET %PROFIT 2.1
SET STOP %LOSS 1.6
ENDIF
IF CONDBUY and Strategyprofit <= 80000 AND strategyprofit>=equitycurve AND mydays>curveperiod THEN
ONCE Positionsize = 1
buy positionsize contract at market
SET TARGET %PROFIT 2.1
SET STOP %LOSS 1.6
ENDIF
I have entered the code so that when strategyprofit crosses below equitycurve trades are paused.
But what it does is stop operating.
I need code so that when strategyprofit crosses again above equitycurve it will trade again.
Thanks.
I don’t know what translator you are using, but you are the only one who ALWAYS posts text this way. I often use translators, but this mess doesn’t happen. Please remove embedded HTML codes, before posting.
You’ve already been answered, Once you have paused a strategy because STRATEGYPROFIT crosses UNDER the equity curve, there’s no way to cross above again as no further trades are allowed.
You can only time the PAUSE, so that the PAUSE expitres after N bars or the next day, or when there is a new highest HIGH or lowest LOW, etc… THe equity curve will stay flat until you start trading again!
LinkParticipant
Senior
To Big problems Big Solutions!
🙂
LinkParticipant
Senior
What tools can be used to draw an equity curve ???