admin管理员组文章数量:1124161
I have a few different alerts running in TradingView using PineScript v5 which often get stopped due to being triggered too frequently. I believe TradingView limits alerts to 15 within a 3 minute period. Is it possible to add something to my strategy to where it will not trigger an alert if the oldest alert (15th) was less than 3 minutes ago?
I’m very novice when it comes to PineScript, or really any language for that matter. I understand how to look back 15 bars but don’t quite get how to look back 15 alerts. Below is a sample code which would trigger more frequently than TradingView allows. On a normal candle chart, this isn't an issue because the data is time based. I run into this issue when using non standard charts such as renko which are price based and can print multiple bricks within a matter of seconds during large market moves.
//@version=5
strategy(title="Close Over Under High Low", overlay = true)
//Order Entry Parameters
validLong = close > high[1]
validShort = close < low[1]
// Enter trades whenever a valid setup is detected
if validLong
strategy.entry(id='Long', direction=strategy.long, when=validLong)
alert('buy', alert.freq_once_per_bar)
if validShort
strategy.entry(id='Short', direction=strategy.short, when=validShort)
alert('sell', alert.freq_once_per_bar)
本文标签: pine scriptTradingViewLimit trades based on timeStack Overflow
版权声明:本文标题:pine script - TradingView - Limit trades based on time - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736611044a1945443.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论