I have a condition to buy future in set 1
now in set 2 I have following condition:
If true, an ATM put is bought with current week expiry.
Basically, I buy nifty future in set 1 and exit if certain conditions are met as specified in set 1 exit.
Now in set 2, if a position exists in set 1 and (15 minute candle makes a new low or time is more than 1520), i want to buy atm put.
In set 2 exit, the net quantity in set 1 is 0 or (15 minute candle makes a new high and time is less than 1520)
similarly, in set 3 i sell future and buy call in set 4 based on net quantity in set 3.
Issues:
Entry occurs in set 2, at 1520 without a position in set 1.
exit does not happen when condition is met in set 2 exit