I have been trying to find a colored EMA/SMA for quite sometime & have had trouble finding such. I saw a member (Chewie76) post this below as this is the kind of colored EMA/SMA I am looking for. Wondering if anyone has something similar & is willing to share the script or help me create me own. Thank you in advance, and have a wonderful day.
-Cash
input price = close;
input length = 21;
input displace = 0;
input showBreakoutSignals = no;
plot MovAvgExponential = Average(price[-displace], length);
plot UpSignal = price crosses above MovAvgExponential;
plot DownSignal = price crosses below MovAvgExponential;
UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);
def higher = MovAvgExponential > MovAvgExponential[1];
def lower = MovAvgExponential < MovAvgExponential[1];
MovAvgExponential.SetDefaultColor(GetColor(1));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
MovAvgExponential.SetPaintingStrategy(PaintingStrategy.LINE);
MovAvgExponential.AssignValueColor(if Higher then Color.green else if Lower then color. RED else Color. CYAN);
MovAvgExponential.SetLineWeight(2);
I have been trying to find a colored EMA/SMA for quite sometime & have had trouble finding such. I saw a member (Chewie76) post this below as this is the kind of colored EMA/SMA I am looking for. Wondering if anyone has something similar & is willing to share the script or help me create me own. Thank you in advance, and have a wonderful day.
-Cash
This is for 21 EMA so if you need different avg# just go in script and change the numbers...
input price = close;
input length = 21;
input displace = 0;
input showBreakoutSignals = no;
plot MovAvgExponential = Average(price[-displace], length);
plot UpSignal = price crosses above MovAvgExponential;
plot DownSignal = price crosses below MovAvgExponential;
UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);
def higher = MovAvgExponential > MovAvgExponential[1];
def lower = MovAvgExponential < MovAvgExponential[1];
MovAvgExponential.SetDefaultColor(GetColor(1));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
MovAvgExponential.SetPaintingStrategy(PaintingStrategy.LINE);
MovAvgExponential.AssignValueColor(if Higher then Color.green else if Lower then color. RED else Color. CYAN);
MovAvgExponential.SetLineWeight(2);