Within 1 bars in scanner

Stockmarker

Member
VIP
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...
 

Stockmarker

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.
 

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...
 

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Top