Calculating PnL from log prices

Discussion in 'Automated Trading' started by Arti, Oct 18, 2015.

  1. Arti

    Arti

    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. 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?
     
  2. 2rosy

    2rosy

    Convert back with exp()
     
  3. If I may give you some recommendatuons:

    * Return is never calculated on a log basis. Profit and loss is calculated on a real return basis like this: number shares * indicator {long =1, short = -1} * (price (exit time) / price (entry time) -1)

    * you should run the same calculation above for each individual leg and add pnl together. That is what is industry practice

    * log prices and log returns are used for specific purposes (and I can explain why if you desire) in asset pricing especially on there derivatives side. Some use log prices or log returns for strategy signal generation purposes as well in order to avoid a bias in regards to whether your base is higher or lower. But it is never used for real pnl computation.

     
  4. Arti

    Arti

    Yes, i'm using log prices only for signal generation and calculating PnL as per your example using real stock prices, but I would like to know if it is correct to use Beta obtained from log prices regression as a multpier to the number of shares on for X stock leg? Judging by back backtest's it's totaly fine, however it always could be a selection bias of the current stock sample.
     
  5. Sergio77

    Sergio77

    KISS
     
  6. The answer is simply: use the number of shares the system calculated and indicated for each leg at the time of trade entry.

     
  7. Butterfly

    Butterfly

    these calculations all seems pretty amateurish,