TradingView Strategy Going in Loop

Hello,

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 ?

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.