[英]the 5 EMA pine script is giving wrong results
Below is pine script.下面是松脚本。 Why it is marking the highlighted candles as alert if none of the criteria is matching.
如果没有任何条件匹配,为什么它会将突出显示的蜡烛标记为警报。
ema5 = ta.ema(close, 5 )
plotshape( close[1]>ema5 and low[1]>ema5 , title="AlertC", text="Alert",color=color.new(#FF000D,50), location=location.belowbar, style=shape.labeldown, size=size.tiny, textcolor=color.white)
You are using the []
history reference operator in your condition.您在您的条件下使用
[]
历史引用运算符。 That means, you are checking if the previous close and previous low prices are greater than the current ema5
.这意味着,您正在检查前一个收盘价和前一个低价是否大于当前的
ema5
。
You should look at the ema line on a bar and compare its value with the previous candle's low and close price.您应该查看柱上的均线并将其值与前一根蜡烛的低价和收盘价进行比较。 Where you marked "incorrect" seems to be correct.
您标记为“不正确”的地方似乎是正确的。 The previous candle's low is above the ema line at 09:15.
前一根蜡烛的低点位于 09:15 的均线上方。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.