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

#### UT2Pro1689

##### Member
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?

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;
#``````

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

Code:
``````declare lower;
plot Data100 = 100;
plot data0   = 0;
plot data50  = 50;``````

Last edited:

87k+ Posts
275 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?