Tradingview integration with tradetron for weekly expiry nifty50

Hello Guys ,I have integrated trading view alerts with tradetron and executing my nifty50 options of weekly contract.now I am trying to implement a strategy where if it is Thursday and want to enter into the position then it should take of next week expiry.but say suppose if I am holding any position on Wednesday then the exit should happen as previous position holding.Is it possible to achieve that?

position you are holding is taken through TradeTron ?