Skip to content
All library documents

Building Continuous P&L and NAV for Changing Positions

Article Quant Q&A · Author: Stacey

Summary

This note explains how to turn daily profit and loss into a continuous account value and net asset value series when a position can grow or shrink without being fully closed. The proposed approach starts from an assumed account value, adds each day's P&L to that value, then compounds NAV by the ratio of the new account value to the previous one. A NAV series can then support period returns or be plotted like a continuously valued asset.

The example concerns daily equity trades at the close and includes transaction costs, though the response's equations do not incorporate costs directly; it says costs should be deducted from daily P&L before updating account value. It also cautions that the initial capital assumption depends on how the strategy will fit into a larger portfolio, especially if it trades several securities or allocates among signals. The suggested daily return denominator is prior-day exposure. No external benchmark or independent validation is supplied, so implementation should verify the timing and treatment of cash flows, costs, and exposure conventions.

Key ideas

  • Add daily P&L to account value to maintain a continuous account balance.
  • Derive NAV by scaling the prior NAV by the ratio of current to prior account value.
  • Deduct trading costs from daily P&L before updating account value and NAV.
  • The initial capital assumption should reflect the intended portfolio context.
  • Daily percentage P&L based on prior-day exposure may avoid distortions as exposure changes.

Tags

Full text
# Continuous Percentage Profit and Loss calculation


# Continuous Percentage Profit and Loss calculation












I need to calculate a profit and loss for an equity timeseries. The position size (column D in the below table) is not binary (not moving from zero position to a position and then back to zero position again - the position can increase and decrease over time without closing). The trades are at the close (so one trade a day).

I have looked for an on-line benchmark source for this function but I cannot find one. Below I have come up with what I hope is the correct way to do this but if someone could let me know if I'm incorrect (and if not correct my equations), or point me towards a source of information it would be appreciated.

cost = 1.35 bases points or (0.0135%)

```
       (A)           (B)           (C)         (D)       (E)                   (F)
    date        close_price   trade_price   position  trade size    cash - nominal position
    30/10/2014       343.70        343.70     -27400      -27400                    9417380
    31/10/2014       357.90        357.90     -26300        1100                    9806460
    03/11/2014       357.90        357.90     -26300           0                    9412770
    04/11/2014       363.87        363.87     -26300           0                    9569781
    05/11/2014       368.77        368.77     -26300           0                    9698651
    06/11/2014       365.22        365.22     -26300           0                    9605286
    07/11/2014       367.81        367.81     -25600         700                    9673403
    10/11/2014       359.29        359.29     -25600           0                    9197824
    11/11/2014       370.85        370.85     -25600           0                    9493760
    12/11/2014       375.08        375.08          0       25600                    9602048

               (G)                     (H)                (I)                    (J)
cash - pnl position before cost     cost (%)    % day pnl before cost   % day pnl after cost
                             0       0.0135%                    0.00%                 -0.01%
                       -389080       0.0135%                   -3.97%                 -3.98%
                             0       0.0000%                    0.00%                  0.00%
                       -157011       0.0000%                   -1.64%                 -1.64%
                       -128870       0.0000%                   -1.33%                 -1.33%
                         93365       0.0000%                    0.97%                  0.97%
                        -68117       0.0135%                   -0.70%                 -0.72%
                        218112       0.0000%                    2.37%                  2.37%
                       -295936       0.0000%                   -3.12%                 -3.12%
                       -108288       0.0135%                   -1.13%                 -1.14%
```

I've tried to explain the above table below using a MS Excel formula style calculations below (the letters in the equations are the columns associate with the above columns)

Thanks

## Answer by amdopt (score 3, accepted)

https://quant.stackexchange.com/a/57592

There is more than one way to approach this. Given your comment that this is a small strategy in a larger account, I assume that you are testing it and, if it bears enough fruit, you may want to scale it up. You should assume some starting value. I'm going to assume a number that's equal to your initial nominal value (as you requested in your comment). Without knowing how you are going to structure a portfolio of trades for this model (i.e. will the model trade more than one security at a time in the future? How will you allocate between multiple trading signals to optimize a portfolio of trades for this model?), you may have to do some (or a lot!) or adjusting to that assumption. For the sake of a running P&L though we can keep the example simple. I would just add a continuous account value column and derive a NAV from it.

Where:

$K_t = K_{t-1} + G_t$

$L_t = L_{t-1}\times(K_t/K_{t-1})$

From the NAV column, you can derive % changes for any period you want or plot it directly as if it is the continuous rolling price of a security. This will be helpful should your strategy perform well and someone wants to analyze it further.

Note that I did not factor in your costs or utilize columns $H$, $I$, or $J$ at all. Adding your trade costs into the daily pnl column would then include them in the Account Value and the NAV for the columns I added.

I also think that your column $I$ is incorrect. If you need to use that column for some reason, I would adjust it to be $I_t = G_t / F_{t-1}$ as today's % gain should be based on the closing exposure of the prior day. I wouldn't recommend using column $I$ the way you are though. It's not accurate--i.e., in your example, the nominal increases as the short position loses money making your daily % moves a bit off compared to the NAV column.

I hope this helps.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.