Within 1 bars in scanner

When I mention that "within 1 bars" , it is not giving the correct data through scan.
Example : I'm setting up the scan where RSI crosses 80 value within 1 bars, it displays the results(stocks info) which are crossed 5 bars before.

Can you pls help me with this case?
 
Last edited by a moderator:

rad14733

Well-known member
VIP
At the time the result paints it happened 1 bar ago, it isn't only going to show what happened one bar before the last bar to paint... Can you post a pic of this...??? And what is your exact code logic... The code helps too...
 
@rad14733 Thanks for your response.
Looks like it is working fine now, not sure why :)

Problem: Trying to get the stock details which are crossing RSI 80 (Day chart) within 1 bars (I'm only looking for the details where RSI crossed above 80 in last bar).

I removed within 1 bars statement from my scan then it displays the correct information.
 

rad14733

Well-known member
VIP
@rad14733 Thanks for your response.
Looks like it is working fine now, not sure why :)

Problem: Trying to get the stock details which are crossing RSI 80 (Day chart) within 1 bars (I'm only looking for the details where RSI crossed above 80 in last bar).

I removed within 1 bars statement from my scan then it displays the correct information.
Glad it's working for you... (y)

Yes, if you are only looking back to the previous bar you can omit the "within 1 bar" clause... 💡
 

yaarione

New member
how to add the "within 5 bars" clause in the custom script?

right now, I am manually changing patternPlot[1] next patternPlot[2], and so on to find a pattern and how it performed after that.
 

rad14733

Well-known member
VIP
how to add the "within 5 bars" clause in the custom script?

right now, I am manually changing patternPlot[1] next patternPlot[2], and so on to find a pattern and how it performed after that.

It all depends on what you are looking for as far as data... The basic within concept, which is covered in the Thinkscript Learning Center, is something like close > ema21 within 5 bars...
 
Top