Signal Test/Show Bar Issue

Hello,

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])

jup.png

Hi Jeff,

You can use the PLSC() function with a TIMESINCESIGNAL() function, so for Jupiter changing signs within 3 days of the signal:

h1 = BARTYPES().Higher; 
l1 = LOW(); 
R1 = (h1[1] == 1) and (l1 < l1[1]); 
NOREPEAT(R1, BARS=5) 

and TIMESINCESIGNAL(PLSC(PLANETS=[Jupiter]))<3

Hiii

What does the below code signifies.

h1[1] == 1

Regards,
Deepak

            

Hi,

h1 sets the variable BARTYPES().Higher and the [1] offsets it by 1 bar. Finally the == 1 means we’re looking for a True result.

In summary the line means the previous bar is a Higher bar.