Hi, and wondering if someone can help with this script. The script below will generate a chart label if one EMA crosses above another, It can be used in any chart, but I would like to modify it so the user can see the lable using two time frames. For example, if using a 1 minute chart, I would like the script to to display an EMA cross on a 5 minute chart as well. Of course I can load a second chart onto TOS with the second time frame and watch both of them, but that takes space. I would like to see both labels on whatever chart I have loaded. Can anyone help?
input AvgType = AverageType.EXPONENTIAL;
input PaintBars = yes;
input ShowBubbles = yes;
input ShowLabels = yes;
input UseEmaCross = yes;
input EMA1 = 10;
input EMA2 = 20;
def EMA1Val = MovAvgExponential(close, EMA1);
def EMA2Val = MovAvgExponential(close, EMA2);
def EMADirection = if EMA1Val > EMA2Val then 1 else if EMA1Val < EMA2Val then -1 else 0;
AddLabel(ShowLabels and UseEmaCross, "EMA: " + (if EMADirection == 1 then "Bullish" else if EMADirection == -1 then "Bearish" else "Neutral"),
if EMADirection == 1 then Color.GREEN else if EMADirection == -1 then Color.RED else Color.GRAY);
input AvgType = AverageType.EXPONENTIAL;
input PaintBars = yes;
input ShowBubbles = yes;
input ShowLabels = yes;
input UseEmaCross = yes;
input EMA1 = 10;
input EMA2 = 20;
def EMA1Val = MovAvgExponential(close, EMA1);
def EMA2Val = MovAvgExponential(close, EMA2);
def EMADirection = if EMA1Val > EMA2Val then 1 else if EMA1Val < EMA2Val then -1 else 0;
AddLabel(ShowLabels and UseEmaCross, "EMA: " + (if EMADirection == 1 then "Bullish" else if EMADirection == -1 then "Bearish" else "Neutral"),
if EMADirection == 1 then Color.GREEN else if EMADirection == -1 then Color.RED else Color.GRAY);