Is it possible to plot a horizontal line at the center of a vertical axis?

Is it possible to plot a horizontal line across the center of a vertical axis?

I have a chart with a left and a right vertical axis. The values of the top (which is usually higher than the highest high) of the vertical axis may change. Is it possible to plot a horizontal line across the center of a vertical axis?
 
Is it possible to plot a horizontal line across the center of a vertical axis?

I have a chart with a left and a right vertical axis. The values of the top (which is usually higher than the highest high) of the vertical axis may change. Is it possible to plot a horizontal line across the center of a vertical axis?

not sure on your question.
it is possible to plot a line in the middle , of the highest and lowest.... maybe that is close enough?

Code:
def h = highestall(high);
def l = lowestall(low);
def mid = (h+l)/2;
plot z = mid;
#
 
not sure on your question.
it is possible to plot a line in the middle , of the highest and lowest.... maybe that is close enough?

Code:
def h = highestall(high);
def l = lowestall(low);
def mid = (h+l)/2;
plot z = mid;
#
Thanks. But This is not what I need. Let's say the price high is 200 and low is 100. But the high of the vertical axis of the chart may be 215 while the bottom may be 95. I need to find a way to plot in the middle of the chart (215+95)/2.
 
Thanks. But This is not what I need. Let's say the price high is 200 and low is 100. But the high of the vertical axis of the chart may be 215 while the bottom may be 95. I need to find a way to plot in the middle of the chart (215+95)/2.
why would The vertical Axis go up to 215.? Is there something plotting to cause that ? those other shapes / studies will have to be considered to find the highest and lowest. you would have to read values from other studies ( if they are stock studies) or copy their code into your study, to compare to, to find the highest object.
 
Thanks. But This is not what I need. Let's say the price high is 200 and low is 100. But the high of the vertical axis of the chart may be 215 while the bottom may be 95. I need to find a way to plot in the middle of the chart (215+95)/2.

This may do what you want. The code is set to a lower pane. Move it to the upper price pane and uncheck the use left axis and the plots for 100 and 0, which will hide all off those, leaving the line in the middle of the chart See linked chart. https://tos.mx/heWrLFC

Screenshot 2024-01-09 132432.png
Screenshot 2024-01-09 132747.png
Code:
declare lower;
plot Data100 = 100;
plot data0   = 0;
plot data50  = 50;
 
Last edited:

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
396 Online
Create Post

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