Hello, working on a new system for myself and realized it would be advantageous to have a script that would help confirm momentum by plotting a dot below a candle when it closes above the 9 EMA and above a candle when it closes below the 9 EMA. Don't know if something like this exists already, but since the 9 EMA is used in momentum day trading often, I have to imagine it does. Have the dot plot just once at the start of the trend would all that I would need and only plot again when the trend changes. If anyone has something, I'd appreciate a copy of it.
Okay, so I found this existing script that @BenTen made for someone. It plots an arrow after a second candle closes above the 9 EMA. I copied his script to create the same rule for closing below the 9 EMA after two candles. However, I don't want the arrows to continue above or below every candle respective of if it's a uptrend or a downtrend. I would like it to plot just one arrow after the close of the second candle on an uptrend or down trend, and not for the entire trend. Too messy. Then when a single candle does close below or above the 9 EMA counter to the prior trend, a yellow arrow would plot to alert to a momentum change. I can copy and paste, but I am in no way proficient in ThinkScript. Here is the existing code:
]input price = close;
input length = 9;
input displace = 0;
input showBreakoutSignals = no;
plot AvgExp = ExpAverage(price[-displace], length);
def condition = close[1] > AvgExp and close > AvgExp;
plot UpSignal = condition;
AvgExp.SetDefaultColor(GetColor(1));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
def condition1 = close[1] < AvgExp and close < AvgExp;
plot DownSignal = condition1;
AvgExp.SetDefaultColor(GetColor(2));
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Alert(DownSignal, " ", Alert.BAR, Sound.Chimes);[/CODE]
Okay, so I found this existing script that @BenTen made for someone. It plots an arrow after a second candle closes above the 9 EMA. I copied his script to create the same rule for closing below the 9 EMA after two candles. However, I don't want the arrows to continue above or below every candle respective of if it's a uptrend or a downtrend. I would like it to plot just one arrow after the close of the second candle on an uptrend or down trend, and not for the entire trend. Too messy. Then when a single candle does close below or above the 9 EMA counter to the prior trend, a yellow arrow would plot to alert to a momentum change. I can copy and paste, but I am in no way proficient in ThinkScript. Here is the existing code:
]input price = close;
input length = 9;
input displace = 0;
input showBreakoutSignals = no;
plot AvgExp = ExpAverage(price[-displace], length);
def condition = close[1] > AvgExp and close > AvgExp;
plot UpSignal = condition;
AvgExp.SetDefaultColor(GetColor(1));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
def condition1 = close[1] < AvgExp and close < AvgExp;
plot DownSignal = condition1;
AvgExp.SetDefaultColor(GetColor(2));
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Alert(DownSignal, " ", Alert.BAR, Sound.Chimes);[/CODE]