I an calculating intraday p&l for my algo. The steps are 1) get all positions 2) foreach (Position position in trades.Day) { totalProfit = totalProfit + position.PNL;
}
The problem is I am getting inconsistent results. I have sold NIFTY MAY 15250 CE and NIFTY MAY 15250 PE at 9:40 AM today (24-may-2021) I have not seen a change in the market between 5/24/2021 10:04:21 AM and 5/24/2021 10:04:53 AM But there is a variation in the total profit of more than 400% without any market movement.
The multiplier value is provided in the positions call only. This is required for currency and commodities positions where the trading unit and the lot size are not the same. For example, the lot size of USDINR contracts is 1 but 1 lot refers to 1000 quantity of the trading unit.
pnl = (sellValue - buyValue) + (netQuantity * lastPrice * multiplier);
Can you please let me know what is this multiplier