I want to run a signal test with a “low of the high bar” or “high of the low bar” entry sell/buy signal and have the script below. However, when combined with other criteria, it is excluding a lot of the signals that I am looking for. Is there a way to have this signal fire within +/- 3 bars of other entry criteria? For instance, when Jupiter changes to Aquarius, I would not need this exact point to exceed the Low of the high bar. I would need the signal to fire on the elongated red bar since the price closed below the previous high, within 3 bars of Jupiter changing signs.
h1 = BARTYPES().Higher;
l1 = LOW();
R1 = (h1[1] == 1) and (l1 < l1[1]);
NOREPEAT(R1, BARS=5)
and
PLSC(PLANETS=[Jupiter])