Now I know how to index the first bar after EMA1 cross above EMA2 :
(CrossAbove(EMA1, EMA2, 1)
But how to index the last bar that before EMA1 cross above EMA2?
Or is any function that I can get 3 or 5 bars around the cross happened,for example bar[-2] bar[-1] bar[0] bar[1] bar[2]
So that I can add the condition:If there is any green bar with the 5 bars around the cross happen,I go long.
Comment