I would like to develop an entry strategy based on two crossing SMAs and the second condition that the following 5 days (after the crossing) are above the slow SMA line. My first idea was to check for 5 closings above the slow SMA first (using a "for loop"). If 5 following closings were above the slow SMA I added a CrossAbove (SMA1 SMA2, 5) function as a second condition.
The problem is, that the CrossAbove function provides a True if there was a crossing above WITHIN the lookbackperiod. That means, my idea does not work as the second condition provides always a True for the last 5 days.
Can anyone give me a hint how to solve that problem? I could not find a similar question in the forum.
Thanks
Comment