1
vote
2answers
633 views

Calculate Average Price, Cost, (Un)Realized P&L of a position based on executed trades

We have built an algorithmic trading software and need to calculate the following parameters for each position in our portfolio. Average Price Cost Realized Profit & Loss Unrealized Profit & ...