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

J

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
 
N

NPTrading

New member
VIP
@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:
J

jr2146

New member
@NPTrading Thank you, I will try this on Monday and let you know if it works... Thank you again for your help.

Just a FYI, The code works good, Thank you
 
Last edited by a moderator:

Similar threads

Top