Sometimes, there are multiple buys and sells in the same instrument. This creates a lot of in and out trades, or round trips. In this situation, there are chances that the average prices shown on Sensibull are negative and won’t match with the ones shown by the broker.

This is because of the difference between average price logics of Sensibull and the broker.

In Sensibull, we reverse calculate the average price from the P&L we get from the broker. (LTP - Average Price) x Quantity is the calculation for P/L, hence average price will be

P&L = (LTP - Avg. Price) * Qty.

P&L/ Qty. = LTP - Avg. Price

-Avg. Price = (P&L/ Qty.) - LTP

Avg. Price = LTP - (P&L/ Qty.)

Let’s take an example here to understand how it works. Suppose you sold 2 lots of 16500 Put at 300 as the average price. And then you bought 3 lots of 16500 Put at 150 as the average price. Effectively, you have squared off the 2 lots sold by you and then bought 1 more lot. Now, let’s suppose that the last traded price (LTP) of 16500 Put is 250.

So, the realized P/L for 16500 Put is (Exit Price - Entry Price) * Sell Quantity

(150 - 300) * (-100) = 15000

Unrealized P/L for 16500 Put is (LTP - Average Price) * Buy Quantity

(250-150) * 50 = 5000.

So the total P/L comes to 20000.

Now, the broker takes the price at which the last buy order was placed as the average price. So, in this case, the broker will show 150 as the average price.

As per broker,

 Average Price Last Traded Price Quantity Total P/L 150 250 50 20000

But, as per Sensibull’s calculation, we reverse calculate the average price from the P/L we get from the broker.

Average Price = (250*50 - 20000)/ 50 = -150

So as per Sensibull,

 Average Price Last Traded Price Quantity Total P/L -150 250 50 20000

At this point, it comes down to a difference in ‘what’ is average price. Different brokers use different definitions of what that is. As far as Sensibull is concerned, we find that the average price definition that makes most sense is one that is derived from a fact rooted in reality: your P&L.

Enforcing that ‘Avg. Price = LTP - (P&L/ Qty.)’ is never violated simplifies a lot of accounting that you see in places like Strategy Builder where we need to tally both live and squared off positions.

This happens only when there is a lot of in and out in the same position. Also, this difference in average price will be seen only on the day the position has been partially exited and adjustments have been made.