I am creating a simple trend-following strategy wich enters long positions when the current close price is greater than the last 50 highs:
(Close[0] > MAX(High, 50)[1]
The problem occurs when this period contains a rollover gap, dirting the trend information, once the gap is incorporated into the data series.
How can I deal with this behaviour?
I found the following link explaining how to fix this problem manually, for each roll over. Is there a programming way to bypass this problem?
thank you so much.
Comment