How place/backtest an options order from BANKNIFY Chart


I want to trade weekly banknifty options.

While main setup is for BANKNIFY-I candle chart, once a BUY/SELL signal is generated on BANKNIFTY-I chart setup, i want to BUY/SELL the corresponding OTM CE/PE option chain.

Can someone share the any code snippets/references to handle this?