How buy average is calculated for F&O trades?

How buy average is calculated for F&O trades?

The buy averages for Futures and Options (F&O) are determined using the FIFO (First In, First Out) method. 

To illustrate, 

Below is the table in which we have assumed the Nifty Lot size as 25 Quantities, along with explanations:

Date Buy/Sell Lots Rate Value Explanation
Jan 1st Buy 5 Rs. 200 Rs. 25,000 Purchased 5 lots at Rs. 200 per lot, totaling Rs. 25,000.
Jan 10th Buy 5 Rs. 220 Rs. 27,500 Purchased another 5 lots at Rs. 220 per lot, totaling Rs. 27,500.
Jan 14th Sell 2 Rs. 250 Rs. 12,500 Sold 2 lots at Rs. 250 each.


Explanation
Jan 1st Purchase: Bought 5 lots at Rs. 200 each, totaling Rs. 25,000.

Jan 10th Purchase: Added another 5 lots at Rs. 220 each, totaling Rs. 27,500.

Jan 14th Sale: Sold 2 lots at Rs. 250 each.

The FIFO principle dictates that the 2 lots sold on Jan 14th are drawn from the 5 lots bought on Jan 1st. As a result, the Profit & Loss (P&L) for this period shows a booked profit of Rs. 2,500 {(250-200) * 50}.

The new average rate is recalculated considering only the remaining lots bought on Jan 1st and the new lot bought on Jan 10th. This calculation results in a new average rate of Rs. 212.5.

According to this method, securities that are acquired first are also the ones sold first.