Super Simple Mid Point Value

Trigun1127

Member
I just need to display at the top of the screen where it shows the OHLC what the Midpoint of a candle is. I did see this code below on the think or swim website.



plot CandleBodyTop = MidBodyVal() + 0.5 * BodyHeight();
plot CandleBodyBottom = MidBodyVal() - 0.5 * BodyHeight()

Ah I forgot also for it display the price 5 points below the Low of that candle as another value. This is for futures btw
 
Solution
I just need to display at the top of the screen where it shows the OHLC what the Midpoint of a candle is. I did see this code below on the think or swim website.



plot CandleBodyTop = MidBodyVal() + 0.5 * BodyHeight();
plot CandleBodyBottom = MidBodyVal() - 0.5 * BodyHeight()

Ah I forgot also for it display the price 5 points below the Low of that candle as another value. This is for futures btw

The midpoint of a candle is measured from high to low, known as HL2, unless you want the Mid candle body you provided. If mid candle body, then replace HL2 with ((CandleBodyTop + CandleBodyBottom)/2).

Also, I don't trade futures, so I used 5 ticks for computing your revised Low value. If you did not mean ticks, then just edit the...

SleepyZ

Well-known member
VIP
Lifetime
I just need to display at the top of the screen where it shows the OHLC what the Midpoint of a candle is. I did see this code below on the think or swim website.



plot CandleBodyTop = MidBodyVal() + 0.5 * BodyHeight();
plot CandleBodyBottom = MidBodyVal() - 0.5 * BodyHeight()

Ah I forgot also for it display the price 5 points below the Low of that candle as another value. This is for futures btw

The midpoint of a candle is measured from high to low, known as HL2, unless you want the Mid candle body you provided. If mid candle body, then replace HL2 with ((CandleBodyTop + CandleBodyBottom)/2).

Also, I don't trade futures, so I used 5 ticks for computing your revised Low value. If you did not mean ticks, then just edit the label to be (low - 5) instead of as displayed (low - TickSize() * 5)

Code:
AddLabel(1, "M: " + hl2, Color.WHITE);
AddLabel(1, "L - 5ticks: " + (low - TickSize() * 5), Color.PINK);

Here is mid candle body and no ticksize()
Code:
plot CandleBodyTop = MidBodyVal() + 0.5 * BodyHeight();
plot CandleBodyBottom = MidBodyVal() - 0.5 * BodyHeight();

AddLabel(1, "M: " + ((CandleBodyTop + CandleBodyBottom) / 2), Color.WHITE);
AddLabel(1, "L - 5: " + (low - 5), Color.PINK);
 
Last edited:
Solution

Trigun1127

Member
This is great thank you. However, Its not displaying the candle that I have my cursor on to display its values. it seems to only do the current candle on the screen. I would like to see the values for any candle that I place my crosshair on.

I just read this is not a possibility elsewhere. Is there any other way that I can quickly view if a candle closed above its midpoint? the Low-5 is actually fine, it would still be nice for it show its value on any candle. Is there a potentially another method?
 

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