# 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)
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

• What was the starting amount of cash in the account? – amdopt Aug 24 at 12:10
• The assumption is that this is a small strategy in a much larger fund so there is cash to cover all trades in the account - If an amount required is can we assume its the nominal cash? – Stacey Aug 24 at 12:39

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.

• Thanks amdopt much appreciated - if I had 2 or more stocks and for each I created a NAV - could you let me know how I would combine them to create a portfolio NAV please? Would it be as simple as (NAV1+NAV2+...+NAVn) / n ? – Stacey Aug 24 at 16:34
• @Stacey I suppose you could do that and look at each NAV as its own security. This would give you a naive 1/N portfolio which may need further optimization or adjusting depending on what you are looking to accomplish. There are lots of past posts on QSE about portfolio optimization. Or perhaps you could ask a new question about it. Lots of people here could help you with that. – amdopt Aug 24 at 17:18