如果有六支绿色蜡烛,则在进入该职位之前,请不要进入
我想制作一个不会在图片中的情况下进入位置的代码。
greenCandle = barstate.isconfirmed and (close > open)
sixGreenCandles = greenCandle[6] and greenCandle[5] and greenCandle[4] and greenCandle[3] and greenCandle[2] and greenCandle[1]
我不知道进入该位置之前要计算蜡烛的代码
(信号处的蜡烛除外)
I'd like to make a code that won't entering the position in a situation like in the picture.
greenCandle = barstate.isconfirmed and (close > open)
sixGreenCandles = greenCandle[6] and greenCandle[5] and greenCandle[4] and greenCandle[3] and greenCandle[2] and greenCandle[1]
I don't know the code to count the candle before entering the position
(Except for the candles at the signal)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
ta.barss()
函数来弄清最后一个红色蜡烛。然后添加一个检查当前条之前是否少于6。与其他购买条件一起使用此条件。You can use the
ta.barssince()
function to figure out when the last red candle was. Then add a check whether this was less than 6 before the current bar. Use this condition together with your other buy conditions.