I have enabled calc_on_every_tick=true
due to I want to receive the alert as soon as possible. But in real-time when too many alerts triggered, tradingview stops that related alert with following message: Stopper -- Too many triggering
. I have to re-enable it in order to use it again.
I have kept pyramiding
as a very high value since I just want to keep receive signal in case the alert is triggered.
As you can see in 1 second multiple alerts might be received, and alert is automatically stopped by the tradingview:
[Q] How can I prevent this from happening while keeping calc_on_every_tick
enabled?
From following answer (Tradingview Pine script save close price at time of strategy entry), I have tried followin code piece to let 30 seconds sleep time, which did not work. Still I have receiving alerts one after another in each millisecond.
Example code piece:
//@version=4
strategy(title="test_strategy",
shorttitle="test_strategy",
calc_on_order_fills=false,
process_orders_on_close=true,
calc_on_every_tick=true, pyramiding=100000)
_timenow = (timenow / 1000)
lastTradeTime = 0
if cond
if (lastTradeTime == 0)
strategy.entry("Long", strategy.long, when=window())
lastTradeTime := _timenow
else
if _timenow > lastTradeTime + 30
strategy.entry("L", strategy.long, when=window())
lastTradeTime := _timenow