Hi everyone,I want to calcuate the realized pnl for a trade. buy the filled price of closing position is the close price of next bar.
data.current(sid,'close') and position[sid].last_sale_price return the price of current bar.
for example, i close position in 10:10,
data.current(sid,'close') and position[sid].last_sale_price return the price ruturn the price of 10:10
but in fact, the order is filled with close price of 10:11 in full backtest.
how can i get the real filld price of next bar in backtest?
thanks for your help.