Hi,
Can you fix this script so the labels can work accordingly based on the ema crossing lines? Need this label (EMA50 > EMA_200) to change colors to cyan if the 50 EMA is above the 200 EMA and color gray if the the 50 EMA is below the 200 EMA (EMA50 < EMA_200).
input price = close;
input length = 50;
input length2 = 200;
input displace = 0;
input showBreakoutSignals = no;
plot AvgExp = ExpAverage(price[-displace], length);
plot AvgExp2 = ExpAverage(price[-displace], length2);
plot UpSignal = price crosses above AvgExp;
plot DownSignal = price crosses below AvgExp;
UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);
AvgExp.SetDefaultColor(GetColor(1));
AvgExp2.SetDefaultColor(GetColor(3));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
input showlabels = yes;
addlabel(!AvgExp > AvgExp2 < AvgExp, "EMA50 > EMA_200", color.cyan);
addlabel(!AvgExp < AvgExp2 > AvgExp, "EMA50 < EMA_200", color.gray);
Can you fix this script so the labels can work accordingly based on the ema crossing lines? Need this label (EMA50 > EMA_200) to change colors to cyan if the 50 EMA is above the 200 EMA and color gray if the the 50 EMA is below the 200 EMA (EMA50 < EMA_200).
input price = close;
input length = 50;
input length2 = 200;
input displace = 0;
input showBreakoutSignals = no;
plot AvgExp = ExpAverage(price[-displace], length);
plot AvgExp2 = ExpAverage(price[-displace], length2);
plot UpSignal = price crosses above AvgExp;
plot DownSignal = price crosses below AvgExp;
UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);
AvgExp.SetDefaultColor(GetColor(1));
AvgExp2.SetDefaultColor(GetColor(3));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
input showlabels = yes;
addlabel(!AvgExp > AvgExp2 < AvgExp, "EMA50 > EMA_200", color.cyan);
addlabel(!AvgExp < AvgExp2 > AvgExp, "EMA50 < EMA_200", color.gray);