Forums › ProRealTime English forum › ProOrder support › strategy BarHunter DAX v1p › Reply To: strategy BarHunter DAX v1p
01/17/2020 at 2:47 PM
#117083
@GraHal Your are quick in testing! It’s a good find but not so good in terms of results at first glance.
As I understand it, the error occurs when the stop is getting placed but is too near to the current high/low.
you can try this. If it still gives an error, increase the minstopdistance slightly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
if longtrading or (longtrading and shorttrading) then minstopdistance=10 //minimum stop distance between stop and current price if intradaybarindex=barnumberlong then breakvaluelong=high //experiment! if high-close<minstopdistance then breakvaluelong=close+minstopdistance else breakvaluelong=breakvaluelong endif endif endif if shorttrading or (longtrading and shorttrading) then if intradaybarindex=barnumbershort then breakvalueshort=low //experiment! if close-low<minstopdistance then breakvalueshort=close-minstopdistance else breakvalueshort=breakvalueshort endif endif endif |