检测图表上的最新信号 [英] Detect latest signal on the chart

查看:13
本文介绍了检测图表上的最新信号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于指示器的问题,可以重新粉刷的指示器。

这个指标看起来不错,但问题是,有时它会突然变化,图表上的最后一个真实信号消失了,但我们没有收到任何延续前一波趋势的新信号,我们失去了趋势浪。

所以,我想在每个真正的烛台上设置一个警告,检查真正的蜡烛或最近的历史蜡烛上的最后一个点是绿色、红色、橙色还是紫色?我如何实现这一点?

如果您能指引我,我将不胜感激。

推荐答案

如果脚本正在计算当前栏的最后(关闭)更新,则变量barstate.isconfirmed变为true。下一个脚本计算将在新的条形图数据上进行。通过将该条件添加到plot()函数中,可以确保在条形图的形成过程中不会绘制任何点。

plot(d, color=white)
plot(barstate.isconfirmed ? bulldiv : na, title = "Tops", color=green, style=circles, linewidth=4)//, offset= -1)
plot(barstate.isconfirmed ? beardiv : na, title = "Bottoms", color=red, style=circles, linewidth=4)//, offset= -1)

plot(barstate.isconfirmed and y10>y2 and oscMax and y3 < y4 ? d :na, title = "Bearish Divergence2", color=orange, style= circles, linewidth=4)
plot(barstate.isconfirmed and y9<y6 and oscMins and y7 > y8 ? d :na, title = "Bullish Divergence2", color=purple, style=circles, linewidth=4)
plot(barstate.isconfirmed and delayedlow<y6 and y7 > y8 ? d :na, title = "Bullish Divergence2", color=purple, style=circles, linewidth=4)
plot(barstate.isconfirmed and delayedhigh>y2 and y3 < y4 ? d :na, title = "Bearish Divergence2", color=orange, style= circles, linewidth=4)

plot(barstate.isconfirmed and long_term_div and oscMax and i and i2 ? d :na, title = "Bearish Divergence2", color=orange, style= circles, linewidth=4)
plot(barstate.isconfirmed and long_term_div and oscMins and i4 and i5 ? d : na, title = "Bullish Divergence2", color=purple, style=circles, linewidth=4)
plot(barstate.isconfirmed and long_term_div and i and i3 ? d :na, title = "Bearish Divergence2", color=orange, style= circles, linewidth=4)
plot(barstate.isconfirmed and long_term_div and i4 and i6 ? d : na, title = "Bullish Divergence2", color=purple, style=circles, linewidth=4)

这篇关于检测图表上的最新信号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆