简体   繁体   English

5 EMA pine 脚本给出了错误的结果

[英]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.

相关问题 Pine 脚本 - EMA 进入“复选框”Boolean 输入? - PIne Script - EMA into a 'Checkbox' Boolean input? 具有多个指标 EMA、交易量和布林线的 pine 脚本 - pine script with multiple Indicator EMA, Volume & Bollinger Pine Script v5、EMA 云和警报 - Pine Script v5, EMA clouds and alerts 在 Pine Script Tradingview 中使用 Security() 的 EMA 问题 - Problem with EMA using Security() in Pine Script Tradingview Pine Script ta.ema 需要数字 arg? - Pine Script ta.ema takes number arg? EMA 交叉 PINE SCRIPT 的利润因子仍然是 NaN - the profit factor still NaN for EMA crossover PINE SCRIPT 如何在 Pine 脚本中根据 EMA-1 的时间范围自动更改 EMA-2 的时间范围 - How can I change the timeframe for EMA-2 based on timeframe of EMA-1 automatically in Pine script plot 每当 50 均线向上或向下穿过 200 均线时,我如何在松脚本中画一条垂直线? - how do i plot a vertical line in pine script whenever the 50 ema crosses up or down the 200 ema? 将策略 Pine 脚本从 v2 转换为 v4,做到了,但得到了不同且错误的结果 - Convert strategy Pine script from v2 to v4 , did it, but got different and wrong results 如何使我的脚本同时适用于 Macd 和 ema 的买入和卖出指标作为 pine 脚本中的条件 - How do I make my script work for both buy and sell indicators for Macd and ema as conditions in pine scripting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM