OPEN-SOURCE SCRIPT

Stacked EMA Confirmation

123
//version=5
indicator(" Stacked EMA Confirmation", overlay=false)

//This script plots a green circle on top of the chart when the EMAs are stacked positively, a red circle if they are stacked negatively and gray if neither positively nor negatively
//The EMAs used are:
//8 EMA
//13 EMA
//21 EMA

//Useful when you look for a quick and easy way to see if these EMAs are stacked positively or negatively as a confirmation
//Default 100 bars back, but that can be adjusted.


StackedLookback = input(100, "How many bars back to show")

ema8 = ta.ema(close, 8)
ema13 = ta.ema(close, 13)
ema21 = ta.ema(close, 21)


conditionMet = ema8 > ema13 and ema13 > ema21
negativeConditionMet = ema8 < ema13 and ema13 < ema21

circleColor = conditionMet ? color.green : negativeConditionMet ? color.red : color.gray

plotshape(series=close, color=circleColor, style=shape.circle, title="Circle", location=location.top, display=display.pane, size=size.auto, show_last=StackedLookback)

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。