I have a question ..I am running Algo and broker is zerodha .for example if I place buy order for 22500 CE today under strategy A and after 2 days I place buy order for 22500 CE under strategy B ,Now if my algo place an squareoff order under Strategy B for 22500 Long CE ,Zerodha close 22500 CE which was bought first (under strategy A) .This create lots of issue for me in PnL Calculation ..how to fix this
F&O positions are settled on a FIFO (First In, First Out) basis when you trade the same contract multiple times, regardless of the strategy used. Please check this support article for more details.