Looking for the chart to plot the last candles H and C.

Gurdaat

New member
Hello! I am looking for a study that will plot the last candle high and close on the top left corner of the chart. Thank you very much. All of the replies are very much appreciated.
 
Solution
You can add a chart label to the upper left corner like this:
Perl:
AddLabel ( yes, "  Last Bar HIGH: " + HIGH + "   Last Bar CLOSE: " + CLOSE + "   ", color.cyan);

the docs for AddLabel are here:
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddLabel

The display string uses + to concatenate strings and values so that the output (label) has some nice notation to help you. you can change the colour as you see fit. I add spaces before and after the values so that the label has some padding and the numbers don't get cut off.

hope that gets you moving in the right direction,
-mashume

mashume

Well-known member
VIP
Lifetime
You can add a chart label to the upper left corner like this:
Perl:
AddLabel ( yes, "  Last Bar HIGH: " + HIGH + "   Last Bar CLOSE: " + CLOSE + "   ", color.cyan);

the docs for AddLabel are here:
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddLabel

The display string uses + to concatenate strings and values so that the output (label) has some nice notation to help you. you can change the colour as you see fit. I add spaces before and after the values so that the label has some padding and the numbers don't get cut off.

hope that gets you moving in the right direction,
-mashume
 
Solution

Gurdaat

New member
You can add a chart label to the upper left corner like this:
Perl:
AddLabel ( yes, "  Last Bar HIGH: " + HIGH + "   Last Bar CLOSE: " + CLOSE + "   ", color.cyan);

the docs for AddLabel are here:
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddLabel

The display string uses + to concatenate strings and values so that the output (label) has some nice notation to help you. you can change the colour as you see fit. I add spaces before and after the values so that the label has some padding and the numbers don't get cut off.

hope that gets you moving in the right direction,
-mashume
Hello! Thank you for your reply.

The problem is that I don't know anything about coding at all. I did try to past the line of code that you provided, but it's showing the current candles H and C.
 

mashume

Well-known member
VIP
Lifetime
If you want the penultimate candle (I thought the most recent would have been the last candle), you can use bracket notation like this:
Perl:
AddLabel ( yes, "  Penultimate Bar HIGH: " + HIGH[1] + "   Penultimate Bar CLOSE: " + CLOSE[1] + "   ", color.cyan);

The bracket notation gives you values increasingly earlier in the series. so that [0] is the current bar (though you don't really need to use zero as it is the default value) and [1] is the bar immediately before the most recent. [10] would be ten bars ago, and [100] would be one-hundred. You can use negative values like [-1] to reference future bars, but even ToS can't predict the future and uses of future bars should be carefully scrutinized before use as they can lead to odd results and lots of repainting.

-mashume
 

Gurdaat

New member
If you want the penultimate candle (I thought the most recent would have been the last candle), you can use bracket notation like this:
Perl:
AddLabel ( yes, "  Penultimate Bar HIGH: " + HIGH[1] + "   Penultimate Bar CLOSE: " + CLOSE[1] + "   ", color.cyan);

The bracket notation gives you values increasingly earlier in the series. so that [0] is the current bar (though you don't really need to use zero as it is the default value) and [1] is the bar immediately before the most recent. [10] would be ten bars ago, and [100] would be one-hundred. You can use negative values like [-1] to reference future bars, but even ToS can't predict the future and uses of future bars should be carefully scrutinized before use as they can lead to odd results and lots of repainting.

-mashume
I just want you to know that you are amazing.

It works perfectly!

Thank you very much!
 

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