Hi,
Can someone help with this script and add a couple of functions to it.
1. Add the option to choose either the SMA or EMA for both 50MA and 200MA to crossover.
2. Add arrow plotting when the 50MA crosses above or below the 200MA on a Heikin Ashi tick chart or minute chart as well.
3. Assign price color like green when the candle closes above the 50MA and the 50MA is above the 200MA, change color to red if the the candle closes below the 50MA and the 50MA is below the 200MA, and finally color gray if the the candles are in between the 50MA and 200MA.
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( 1,(if AvgExp > AvgExp2 then "E50 > E200" else if AvgExp < AvgExp2 then "E50 < E200" else "-"), if AvgExp > AvgExp2 then color.cyan else if AvgExp < AvgExp2 then color.gray else color.Orange);
AddLabel(showlabels, "|", Color.YELLOW);
Can someone help with this script and add a couple of functions to it.
1. Add the option to choose either the SMA or EMA for both 50MA and 200MA to crossover.
2. Add arrow plotting when the 50MA crosses above or below the 200MA on a Heikin Ashi tick chart or minute chart as well.
3. Assign price color like green when the candle closes above the 50MA and the 50MA is above the 200MA, change color to red if the the candle closes below the 50MA and the 50MA is below the 200MA, and finally color gray if the the candles are in between the 50MA and 200MA.
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( 1,(if AvgExp > AvgExp2 then "E50 > E200" else if AvgExp < AvgExp2 then "E50 < E200" else "-"), if AvgExp > AvgExp2 then color.cyan else if AvgExp < AvgExp2 then color.gray else color.Orange);
AddLabel(showlabels, "|", Color.YELLOW);