Help With Plotting only select Bars

QknEasy

New member
I'm looking to only plot specifically selected (continuous) group of Bars. Eventually these will be made variables depending on the 5EMA changes.
For simple example
Input s1 = -5 Start
Input e1 = -3 End
define nb=(e1-s1)+1 number of bars 3

Without going into all the coding detail I have calculated the best fit linear regression line between these points and have generated among other items the following;
b1 Slope
yint1 Y-Intercept

I tried the formula for a line y=mx+b and tried to incorporate BarNumbers(3) but I kept getting a line across the entire chart
I need help on the plot statement that would only show the "straight" line for Bars -5,-4,-3.
Let me know if I need more information
 
I need help on the plot statement that would only show the "straight" line for Bars -5,-4,-3.
Let me know if I need more information

need more info,
not sure what bars -3,-4,-5 is

is that a reference from the last bar?
somewhere on here i have a study that draws a line , on several bars after the last bar. could change the offsets to find a group of bars before the last bar.

found it
https://usethinkscript.com/threads/expansion-area-ma-lines-bubble.11201/#post-97853
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

need more info,
not sure what bars -3,-4,-5 is

is that a reference from the last bar?
somewhere on here i have a study that draws a line , on several bars after the last bar. could change the offsets to find a group of bars before the last bar.

found it
https://usethinkscript.com/threads/expansion-area-ma-lines-bubble.11201/#post-97853
I really meant the bars to be positive i.e. looking back at 3 days in the past and drawing the line for only those days. Thanks I'll look at the study
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
400 Online
Create Post

Similar threads

Similar threads

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