I have a strategy which goes in loop. I get buy and sell signals from Tradingview.
I have following condition in my entry
(I am taking a CALL buy position)
Get Runtime ‘NIFTY’ == number 1
My exit condition for this is
(I am exiting the Call buy position)
Get Runtime ‘NIFTY’ == number -1
and for my Put position
(I am taking a PUT buy position)
Get Runtime ‘NIFTY’ == number -1
My exit condition for this is
(I am exiting the PUT buy position)
Get Runtime ‘NIFTY’ == number 1
can someone help me ? I saw a video of EMA corssover strategy going in loop and it is not explained in detail . I could not understand that at all and I dont think it applies to this condition.
can someone help me ASAP ?
Manish
I think create two set. in one set check for call number and position ==0 to entry and exit as per your condition and set 2 do it for put.
Tradetron TeamTradetron team
A TradingView strategy loops when the value you pushed stays the same after it has been used. A pushed value does not reset itself, so a leftover 1 fires the Call entry again the moment the Call position closes.
Fix
Reset the signal after it is used. In the Runtime section of the condition that consumed the signal, set the variable back to 0, e.g. after the Call entry: NIFTY = Number(0). Or send another API call that sets it to 0.
One signal, two actions. If one -1 both exits the Call and enters the Put, do the reset in the Put Entry (the last block that uses it), not in the Call exit.
Separate sets for Call and Put, each with an open-position check in its entry (e.g. Net Quantity of the other side == Number(0)), so both cannot be open together.
Hybrid Mode = Yes when linking the API token (My Strategies → ⋮ → API OAUTH Token), so Tradetron’s own conditions and exits run too.
For intraday, add a Universal Exit at the end of the day so the next day starts from re-initialized variables.
Check the Runtime Data (Deployed page → ⋮) to see the value the strategy currently holds, and test in Live Offline. A Live Offline strategy crossing 400 trades in a day is blocked as loop protection.
Answer written with AI from Tradetron docs (Oct 2026). Original replies are kept above. Spot something wrong? Reply below.