# Calculating PnL from log prices

I'm backtesting a statistical arbitrage strategy. To calculate the PnL I simply use $Y(t)-Y(t+n)$ for the profit on the first leg and $\beta*X(t) - \beta*X(t+n)$ for the profit on the second leg, then i add both profits together. $Y$ is the number of share on the first leg and $\beta X$ is the number of shares on the second leg, each of the legs is also multiplied by the price of the corresponding share.

Now suppose I would use log prices to calculate the $\beta$. How would the PnL calculation look like then? Would it be appropriate to calculate the PnL by multiplying regular price with the $\beta$ obtained from the log price regression, provided that the long/short signals are received from the spread that was also calculated using log prices? If such approach is not correct then how can you calculate the PnL from the pair while using the log prices?

• If I am interpreting this correctly, it would seem that you are calculating $\beta$ (a constant) using the log of the price series. Also, a given trades payoff is $a((Y(t+n)-Y(t))-(\beta X(t+n)-\beta X(t))$ where $a=1$ if you are long the spread or $a=-1$ if you are short the spread. I couldn't see why you would need to transform $\beta$. – Joseph Zambrano Oct 18 '15 at 14:28
• Yes, β is calculated using the log of the price series and it should show how many X shares must be traded against each Y share. Now this would be true if we would use regular prices, but in case of log prices β actually shows by how much X stock grow's faster (if beta > 1) of slower (if beta < 1) relative to Y share, thus it is questionable to apply β calculated from the log prices to calculate the number of shares to trade with regular prices. – Artem Korol Oct 18 '15 at 16:50
• Were you not asking about P/L? No matter what, if you trade the spread with $Y(t)$ against $bX(t)$ the P/L will be what I stated above. If you are asking about the number of shares to trade then that is a different question. – Joseph Zambrano Oct 18 '15 at 17:23
• The payoff from your first comment would be the continuously compounded return in %, to convert that in to USD you would need to know the amount of capital used on each leg and to get the amount of capital you would need to know the number of shares to trade on each leg. Both things are related. – Artem Korol Oct 18 '15 at 17:32