Well, not sure I’m happy with this. This thread is titled “breakeven-trailing-profit”. It was exactly this phenomenon of putting Trailing Profits above the price (for Longs) that works like a charm. And now, this phenomenon is killed and this code turns into an ordinary trailing stop. You don’t need the last min(close…) or max(close…) modifications to prevent trailing profits, if that’s what you really want. Just fill in “1” instead of “100” in the next line:
Change 100 into 1
1
ProfitPerCent=max(ProfitPerCent[1],min(100,ProfitPerCent))//make sure ProfitPerCent doess not exceed 100%
I guess the limit orders were introduced for a reason. When you eliminate the possibility of Trailing Profits above the price, no need for limit orders anymore. The whole IF … ELSE … ENDIF around stop and limit order can be replaced by one line “SELL AT SellPrice STOP” for longs. That’s what I call an ordinary trailing stop.
Personally I will continue with the extra-ordinary Trailing Profit version. In backtest I have seen 75% of the Limit orders (trailing profit) being granted, only 25% needed the SafetyNet I introduced. Nice bunch of bonusses compared to a trailing stop where you always return a bit to the market. I simplified the part with Steps and Chunks and no longer let BasePercent also influence the increments. Same good results, but simpler and less parameters for the optimiser.
Thanks for your effort.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.