[英]Trading view alerts every bar close, how can i have just one?
I have a problem: Trading view trigger alerts every bar close which is a major problem to me, because pineconnector keeps making orders based on the alerts received.我有一个问题:交易视图触发器在每个收盘时发出警报,这对我来说是一个主要问题,因为 pineconnector 不断根据收到的警报发出订单。
While I have no major experience with pine script, this is a major problem to me, if anyone would help me get the alert just one until the next reverse signal, I would be more grateful.虽然我没有使用 pine 脚本的主要经验,但这对我来说是一个主要问题,如果有人能帮助我在下一个反向信号之前只发出一个警报,我将不胜感激。
This is the code I have on my pine script strategy:这是我在我的松树脚本策略中的代码:
if buy
alert(buy_alert_string,alert.freq_once_per_bar_close)
strategy.entry('buy', strategy.long)
if sell
strategy.entry('sell', strategy.short)
alert(sell_alert_string,alert.freq_once_per_bar_close)
Try whith barstate.isconfirmed试试barstate.isconfirmed
Something like that像那样的东西
if buy and barstate.isconfirmed
alert(buy_alert_string,alert.freq_once_per_bar_close)
strategy.entry('buy', strategy.long)
if sell and barstate.isconfirmed
strategy.entry('sell', strategy.short)
alert(sell_alert_string,alert.freq_once_per_bar_close)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.