Hello, I currently have a simple 9 EMA average script which dynamically changes the color when price above average and when below. Simple. However, in addition to it I'd like to add horizontal dots as a lower study that change colors too (green / red or similar) Not sure how. Any help super appreciated! This is my current code:
Here is an image of the dots I mean (the indicators on this image are unrelated to mine):
Code:
input price = close;
input length = 9;
input displace = 0;
input showBreakoutSignals = no;
plot AvgExp = ExpAverage(price[-displace], length);
plot UpSignal = price crosses above AvgExp;
plot DownSignal = price crosses below AvgExp;
UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);
AvgExp.SetDefaultColor(GetColor(1));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
avgExp.AssignValueColor(if avgExp > avgExp[1] then color.light_green else Color.MAGENTA);
Here is an image of the dots I mean (the indicators on this image are unrelated to mine):
Last edited by a moderator: