darva在renko上的盒子做奇怪的事情

发布于 2025-01-26 21:16:36 字数 1303 浏览 2 评论 0原文

谁能帮助我理解为什么有时此指标在不在图表上绘制买入/出售的情况,而其他时候则在图表上绘制买入/出售,而无需发射买入/出售警报?这是专门针对外汇仪器的Renko传统设置为0.0012。任何输入都将不胜感激。

//@version=5

indicator('Darvas Box Buy Sell', overlay=true)

boxp = input.int(defval=5, title='Length', minval=1, maxval=500)

LL = ta.lowest(low, boxp)
k1 = ta.highest(high, boxp)
k2 = ta.highest(high, boxp - 1)
k3 = ta.highest(high, boxp - 2)

NH = ta.valuewhen(high > k1[1], high, 0)
box1 = k3 < k2
TopBox = ta.valuewhen(ta.barssince(high > k1[1]) == boxp - 2 and box1, NH, 0)
BottomBox = ta.valuewhen(ta.barssince(high > k1[1]) == boxp - 2 and box1, LL, 0)

plot(TopBox, linewidth=2, color=color.new(#4CAF50, 0), title='TBbox')
plot(BottomBox, linewidth=2, color=color.new(#FF0000, 0), title='BBbox')

Buy = ta.crossover(close, TopBox)
Sell = ta.crossunder(close, BottomBox)

alertcondition(Buy, title='Buy Signal', message='Buy')
alertcondition(Sell, title='Sell Signal', message='Sell')

plotshape(Buy, style=shape.labelup, location=location.belowbar, color=color.new(#4CAF50, 0), size=size.tiny, title='Buy Signal', text='Buy', textcolor=color.new(color.black, 0))
plotshape(Sell, style=shape.labeldown, location=location.abovebar, color=color.new(#FF0000, 0), size=size.tiny, title='Sell Signal', text='Sell', textcolor=color.new(color.white, 0))

Could anyone help me understand why sometimes this indicator fires a Buy/Sell alert without plotting Buy/Sell on the chart and other times plots a Buy/Sell on the chart without firing a Buy/Sell alert? This is specifically on Renko Traditional set to 0.0012 for forex instruments. Any input is appreciated.

//@version=5

indicator('Darvas Box Buy Sell', overlay=true)

boxp = input.int(defval=5, title='Length', minval=1, maxval=500)

LL = ta.lowest(low, boxp)
k1 = ta.highest(high, boxp)
k2 = ta.highest(high, boxp - 1)
k3 = ta.highest(high, boxp - 2)

NH = ta.valuewhen(high > k1[1], high, 0)
box1 = k3 < k2
TopBox = ta.valuewhen(ta.barssince(high > k1[1]) == boxp - 2 and box1, NH, 0)
BottomBox = ta.valuewhen(ta.barssince(high > k1[1]) == boxp - 2 and box1, LL, 0)

plot(TopBox, linewidth=2, color=color.new(#4CAF50, 0), title='TBbox')
plot(BottomBox, linewidth=2, color=color.new(#FF0000, 0), title='BBbox')

Buy = ta.crossover(close, TopBox)
Sell = ta.crossunder(close, BottomBox)

alertcondition(Buy, title='Buy Signal', message='Buy')
alertcondition(Sell, title='Sell Signal', message='Sell')

plotshape(Buy, style=shape.labelup, location=location.belowbar, color=color.new(#4CAF50, 0), size=size.tiny, title='Buy Signal', text='Buy', textcolor=color.new(color.black, 0))
plotshape(Sell, style=shape.labeldown, location=location.abovebar, color=color.new(#FF0000, 0), size=size.tiny, title='Sell Signal', text='Sell', textcolor=color.new(color.white, 0))

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南城旧梦 2025-02-02 21:16:36

由于Renko Bar价格是合成的,并且它们在任何精确的时刻都不会反映市场价格,因此

请阅读 this this

Because Renko bar prices are synthetic and they do not reflect market prices at any precise moment in time, as normal bars do,

Please read this, this and this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文