Need help with a label code for /ES futures & /MES Futures

jr2146

New member
I currently have this label code below for the previous candle high, low and 50% retracement that I use on the /ES futures, but I want to have this same code on the /ES chart but to show the levels of the previous candle high, low & 50% for the /MES futures previous candle while I am looking at the /ES futures chart.

here is the current high. low & 50% code:
AddLabel(1, Round(high[1]), Color.WHITE);
AddLabel(1, Round(hl2[1]), color.light_red);
AddLabel(1, Round(low[1]), Color.WHITE);

Also here is another code I have for a Label that shows another stocks information in the label in the upper left hand corner if I put it on a chart:
input u = 0;
input l = -0;
def it = close ("/MES");
AddLabel(open, Concat(it , Concat(" ",
if it < l then "" else if it > u then "" else "")),
if it > u then Color.GREEN else
if it < l then Color.LIGHT_RED else Color.WHITE);


So pretty much I cant figure how to merge both codes together on the label in the upper left hand corner of a /ES futures chart but have the label show the /MES futures information of the previous candels high. low & 50%,

Any help on this would be great.
Thank you
 
@jr2146
I am new to thinkscript. Please check if this is what you need.

Code:
#Current symbol details
AddLabel(1, Round(high[1]), Color.WHITE);
AddLabel(1, Round(hl2[1]), Color.light_red);
AddLabel(1, Round(low[1]), Color.WHITE);

#/MES details
AddLabel(1, "/MES high: " + Round(high("/MES")[1]), Color.WHITE);
AddLabel(1, "/MES hl2: "  + Round(hl2("/MES")[1]), Color.light_red);
AddLabel(1, "/MES low: "  + Round(low("/MES")[1]), Color.WHITE);
 
Last edited:

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
336 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