How to backtest MIS (Intraday Squareoff) strategy

I am trying to backtest intraday MIS strategy with Pi but getting some weird results. The buy and sell occurs only when conditions are fulfilled but I want to exit on day end or some exit conditions (even exit long and exit short conditions seems to be fishy) . Can someone please help me with this.It would be great help if some example with buy & sell script is provided.

In Backtest atleast a buy and a sell scripts is mandatory and exit buy and exit sell scripts are optional, if you want to backtest and check only on the previous day or current day you can select one day with required bar interval

For the tradescript strategy check expert advisor page https://zerodha.com/expert-advisors/

1 Like

i dont know excetly but i provide a link that may help you - https://tradingqna.com/57176/need-a-code-to-back-test and also https://tradingqna.com/31462/how-to-save-the-buy-price-to-calculate-sell-price