Hi. I am trying to create a script being used in a ShowMe that will find the highest Close between the Close crossing above 20 MA and Close crossing below
20 MA for a maximum specified number of bars between. In this example, I am using a maximum of 10 bars between Cross Above and Cross Below
and my code is showing a Signal at the Cross Below. I am using HighestSince but it might not be the right method.
How can I show the Signal at the Highest Close between the 2 Crossovers?
NUMBARS=10;
MA20 = MA(Day(PERIODAMOUNT=1), DATA1, BARS=20, STYLE=Simple, CALC=Close);
Close1 = CLOSE(Day(PERIODAMOUNT=1));
COND1 = Close1 CrossesAbove MA20;
T1 = TIMESINCESIGNAL(COND1);
COND2 = Close1 CrossesBelow MA20;
COND3 = COND2 and (T1 <= NUMBARS) ;
IF(COND3, HIGHESTSINCE(COND1));