higher price close than previous X bars

ARL

New member
Greetings . . . I am trying to get scan results that show a price close that's higher than the previous 12 bar closes. I tried to get this done through the condition wizard, but can't generate the desired results. I realize the solution is probably quite straightforward, would sure appreciate your help.
 

6884jason

New member
VIP
I'm fairly new. to be honest, not even sure what the "condition wizard is". but, within scan, you can add study and select "price change" and modify "close" to be greater than (any) % than the last "12 bars. If that is not what you were looking for or even talking about, please forgive me, I am new. lol.
 

ARL

New member
No problem. Your idea would work but, from the results I get, the study looks at only the 12th bar. I'd like the last close to be higher than ALL of the previous 12 bars.
 

ARL

New member
Thank you, Pensar. This works perfectly . . .
I don't think this is something I could have come up using the condition wizard. I tried using "1-12" as the bar range. Even though I didn't get a syntax error, I didn't get any results, either. This brief line of code solves the problem. Much appreciated.
 

rad14733

Well-known member
VIP
Thank you, Pensar. This works perfectly . . .
I don't think this is something I could have come up using the condition wizard. I tried using "1-12" as the bar range. Even though I didn't get a syntax error, I didn't get any results, either. This brief line of code solves the problem. Much appreciated.
If you tried [1-12] that equated to [-11]... 💡 The Learning Center has an entire section on how to access historical data... ;)
 

XeoNoX

Well-known member
VIP
I'm fairly new. to be honest, not even sure what the "condition wizard is". but, within scan, you can add study and select "price change" and modify "close" to be greater than (any) % than the last "12 bars. If that is not what you were looking for or even talking about, please forgive me, I am new. lol.
you are right, that would have worked as well.
 

Similar threads

Top