admin管理员组文章数量:1126342
My strategy was made for the Daily Timeframe but the alert is triggered at 3:00pm instead of been triggered tomorrow when the market is open how can I fix my script
Strategy
chaikin_length_short = input(10, "Chaikin Fast Length", group="Chaikin Osc")
chaikin_length_long = input(20, "Chaikin Slow Length", group="Chaikin Osc")
chaikin_osc = ta.ema(ta.accdist, chaikin_length_short) - ta.ema(ta.accdist, chaikin_length_long)
buy_condition = barstate.isconfirmed and chaikin_osc > 0
sell_condition = barstate.isconfirmed and (chaikin_osc < 0)
if buy_condition
strategy.entry("Long", strategy.long, qty=equity, comment="Long")
alert(alert_message, alert.freq_once_per_bar_close)
if sell_condition
strategy.close("Long", comment="Cerrar Long")
alert(alert_message, alert.freq_once_per_bar_close)
I need to trigger the alerts for buy_condition and sell_condition when the market is open
My strategy was made for the Daily Timeframe but the alert is triggered at 3:00pm instead of been triggered tomorrow when the market is open how can I fix my script
Strategy
chaikin_length_short = input(10, "Chaikin Fast Length", group="Chaikin Osc")
chaikin_length_long = input(20, "Chaikin Slow Length", group="Chaikin Osc")
chaikin_osc = ta.ema(ta.accdist, chaikin_length_short) - ta.ema(ta.accdist, chaikin_length_long)
buy_condition = barstate.isconfirmed and chaikin_osc > 0
sell_condition = barstate.isconfirmed and (chaikin_osc < 0)
if buy_condition
strategy.entry("Long", strategy.long, qty=equity, comment="Long")
alert(alert_message, alert.freq_once_per_bar_close)
if sell_condition
strategy.close("Long", comment="Cerrar Long")
alert(alert_message, alert.freq_once_per_bar_close)
I need to trigger the alerts for buy_condition and sell_condition when the market is open
Share Improve this question edited 2 days ago Gu5tavo71 1,1611 gold badge6 silver badges17 bronze badges asked Jan 8 at 21:54 Jorge Ter VeenJorge Ter Veen 11 bronze badge New contributor Jorge Ter Veen is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.1 Answer
Reset to default 0barstate.isconfirmed
Returns true in the last (closing) update of the current bar.
Try with session.ismarket
buy_condition = session.ismarket and chaikin_osc > 0
sell_condition = session.ismarket and (chaikin_osc < 0)
本文标签: pine scriptPinescript Strategy Alert Triggered when market closedStack Overflow
版权声明:本文标题:pine script - Pinescript Strategy Alert Triggered when market closed - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736685838a1947660.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论