Hi MaoRai54
I do it as below.
After your many trials etc, do you know if your code vs my code would produce same result (using same values as below in your code)?
Cheers
GraHal
PS use <> when you insert code … makes it so much easier to read.
If shortonmarket then
SET STOP PLOSS 90 //4*AverageTrueRange[30](close)
SET TARGET PPROFIT 75
endif
if longonmarket then
SET STOP PLOSS 125
SET TARGET PPROFIT 150
endif
GraHal – they can’t produce the same results as one only exits at the close of a candle/open of new candle and the other sets an order on the market to close mid candle.
Vonasi
thanks for the clarification.
which is the best way?
which is the best way?
This all depends on the strategy in question. I normally test each strategy with a variety of exit methods to evaluate which works better. It is surprising that more often than not waiting for the candle to close is more profitable but I guess that is only if your prediction of market direction was more likely to be right in the first place. Sometimes it can be heartbreaking to see a 1000 pip profit turn into a 800 pip profit when the market suddenly pulls back just before the candle close. But hey ‘a profit is a profit’ is a good philosophy to have!
Obviously waiting for the candle to close can see you open to some big losers if there is suddenly a very long candle in the wrong direction but this is what your emergency SET STOP %LOSS is for.
It costs nothing to try all ways and see what suits your chosen strategy but always be aware of curve fitting the stops to fit the strategy.