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?