4
$\begingroup$

I have a cumulative profit/loss time series below for a trading strategy, what is the appropriate way to calculate the returns in percentage for such a series?

My issue is the appropriate calculation for when the strategy becomes negative and going forward. I can't take log of a negative number and I am not sure if the arithmetic calculation is appropriate. I would appreciate any suggestions. I am using matlab. Thanks

 1.0e+003 *

    5.2735
    4.3922
    3.1878
    3.6250
    3.6982
    5.3774
    5.5748
    5.0108
    1.0355
   -2.4639
   -4.6589
   -4.2990
   -3.8678
   -3.1051
   -4.5356
   -4.8130
   -8.9671
   -9.0438
   -7.2986
   -7.1849
$\endgroup$
3
  • $\begingroup$ Are you looking for change from one point to the next or over the entire series? Geometric mean is what you're looking for if the entire series is what you're interested in. $\endgroup$
    – jeff m
    Aug 21, 2012 at 14:05
  • $\begingroup$ change from one point to the next $\endgroup$ Aug 21, 2012 at 14:32
  • $\begingroup$ @user1129988, please take a look at my answer, thats exactly how I read your question. $\endgroup$
    – Matt Wolf
    Aug 21, 2012 at 15:11

5 Answers 5

8
$\begingroup$

So those are cumulative pnl figures and you are interested in the percent changes in pnl from one data point to the next? Don't use log returns, simply generate the percent changes through r(t)/r(t-1)-1.

4.3922/5.2735-1 = -16.71% (in your example time series I made the assumption that the time series is in ascending order. Given your description of the above time series data points, the change of your pnl from absolute 5.2735 -> 4.3922 constitutes a decrease by 16.71% of generated pnl. (I am not sure why you wanna get to those numbers this way but this is how you described it, nonetheless).

Using arithmetic returns is completely fine, in fact its preferable over log returns in some instances. I would consider return calculation for return attribution purposes such situation. I know I will probably be down voted by someone for this comment but I am happy to defend this statement if being asked.

$\endgroup$
5
  • $\begingroup$ I agree with you about the arithmetic statement.. but the data was requested in log returns $\endgroup$ Aug 21, 2012 at 14:29
  • $\begingroup$ I see no reason for downvoting but the pros and cons of the different methods is always interesting. So please do elaborate. $\endgroup$
    – Bob Jansen
    Aug 21, 2012 at 14:29
  • 2
    $\begingroup$ @Bob, well simple rational here is that log returns are often used by academicians because the continuously compounded return is symmetric and logs are often convenient in mathematical derivations. However when you invest 100 and a year later you are left with 98 you lost 2% not 2.0202%. When you earn 2 a year after you made about 2.041%, nobody cares at your bank or brokerage that the two numbers are not symmetrical. From other posts of mine you probably realize I am a realist and love simplicity as long as logic is not defied. $\endgroup$
    – Matt Wolf
    Aug 21, 2012 at 15:08
  • 2
    $\begingroup$ @user1129988, thats not what you requested. You asked and stated that you were not sure whether arithmetic calculations sufficed. I answered yes and showed how to do it and gave a rational why sometimes arithmetic calculations are preferable. You explicitly asked for alternative suggestions which I gave. How is my answer in disagreement with what you asked? $\endgroup$
    – Matt Wolf
    Aug 21, 2012 at 15:12
  • $\begingroup$ @Freddy nice comment $\endgroup$
    – Bob Jansen
    Aug 21, 2012 at 20:09
4
$\begingroup$

For me, I would calculate daily returns for such a series by backing out the daily PnL and dividing by some volatility number.

lets define your cumsum as "c_pnl":

daily_pnl   = c_pnl - [0; c_pnl(1:length(c_pnl-1)]
max_draw    = max(cummax(c_pnl) - c_pnl)
pct_returns = daily_pnl / max_draw # in terms of drawdown

Don't you have capital already in the assumptions of your backtest? Why not just use capital? log((capital + pnl)/capital).

Do you trade through time with constant capital or are you compounding on PnL?

edit: jlowin points out margin as another good way. Margin is probably better because capital as it incorporates some level of risk of the strategy and you can compare pnl /margin more easily.

$\endgroup$
3
  • 1
    $\begingroup$ Upvoted because normalizing with capital or margin is definitely the way out of this mess. One hesitation on normalizing with max drawdown, though, is that that some of the pnl numbers are being adjusted by a value not known at the time of that pnl. That could be problematic, for example, if in the future the max drawdown were even larger. In that case, running the same analysis would give different percent returns for these observations. If this is a one-time analysis, maybe it's not an issue, or perhaps it could be fixed by dividing pnl at time t by the max drawdown observed at time t. $\endgroup$
    – jlowin
    Aug 26, 2012 at 1:12
  • $\begingroup$ I agree with you on the forward looking aspect of max drawdown. I wanted something that could easily compare across strategies. $\endgroup$
    – Michael WS
    Aug 27, 2012 at 12:47
  • $\begingroup$ Totally agree and I like your thought a lot. $\endgroup$
    – jlowin
    Aug 27, 2012 at 14:34
1
$\begingroup$

This is a very interesting problem.

I disagree with the use of any form of percent returns -- conventional or logarithmic -- simply because they are nonsensical for negative equity values (I am assuming this price series is from some sort of margined position?). You are forced to choose between the mathematically "correct" returns for those which are "correct" from the point of view of the account holder.

Consider the final two results: a negative equity balance of -7.30 followed by an improvement to a negative balance of -7.18. Conventionally, that's a -1.64% move (-7.18 / -7.30 - 1), even though of course we can see that the account balance is moving positively (in the account holder's favor).

Is it "right"? Sure, mathematically -7.18 is -1.64% from -7.30. But if you try to calculate any statistics off these returns, the winning and losing days will be reversed -- so it's not right from a practicality standpoint and will ruin your perception of the account's performance (like average return, trend, risk).

It is correct, however, if we consider that it is the return experienced by whomever is "in the money" with regard to this margin account at that time. When the account balance is positive, the account holder is (presumably) experiencing gains. When the balance is negative, the margin lender is experiencing gains. Percent returns calculated conventionally are a reflection of their respective positions times the sign of their cumulative profit.

Logarithmic returns suffer from exactly the same problem -- moving toward zero is always considered a "negative" return, disregarding the fact that there is a negative equity balance.

However, for the sake of answering part of your question, you can in fact calculate logarithmic returns for your negative price series, with the exception of the one point where it crosses zero. Note that log(x) - log(y) = log(x/y). Therefore, instead of differencing the log of two numbers, just take the logarithm of their ratio. The example I gave above becomes log(-7.18 / -7.30) = -1.65%, which is very close to the arithmetic result.

At the crossing point, this method will fail, and you may have to fall back on an arithmetic calculation (with all the caveats above).

The best way to do this is to use a margin balance or risk capital position. Add that to the price series to de-lever it and avoid negative balances. Then either method of calculating returns will work as normal.

$\endgroup$
14
  • 1
    $\begingroup$ Please check your math, its simple enough, but you are wrong all over the place, you incorrectly calculate simple percentages, and you get the signage wrong couple times. $\endgroup$
    – Matt Wolf
    Aug 22, 2012 at 3:23
  • 1
    $\begingroup$ " Sure, mathematically -7.18 is -1.64% from -7.30." Since when does that hold true? I must have slept in elementary school. $\endgroup$
    – Matt Wolf
    Aug 22, 2012 at 23:58
  • 1
    $\begingroup$ Alright one fair point is to use abs. Will edit my own answer. However,it still does not make your numbers correct, they are wrong,period. As you can see from your rating I am not the only one who thinks your answer is nonsense. Calculating percentage changes with negative values makes as much sense as with any positive values if care is taken. $\endgroup$
    – Matt Wolf
    Aug 26, 2012 at 10:16
  • 1
    $\begingroup$ @Freddy There's a time for criticism and a time to shut it and move on. When you say things like, "I must have slept in elementary school" and "You definitely do not qualify to even post here", then you are the problem. $\endgroup$ Aug 27, 2012 at 13:13
  • 1
    $\begingroup$ Sorry for being too honest in my assessment. It was just that, a personal opinion. The user can feel free to prove himself with earning his reputation points with quality posts going forward. Not sure where I am the problem here...oh well... $\endgroup$
    – Matt Wolf
    Aug 28, 2012 at 11:35
1
$\begingroup$

I have a cumulative profit/loss time series below for a trading strategy, what is the appropriate way to calculate the returns in percentage for such a series?

Correct me if I am wrong, but it seems to me there is no such thing as return for P&L. Your series contains net income which itself is a return. You could calculate the relative change for your series, but it has no meaning when you switch from profit to loss and vice versa. Here is the relevant discussion with the link to WSJ not providing percent change for net income in such scenario.

$\endgroup$
-1
$\begingroup$

One workaround for this is to add to the cumulative profit and loss the initial equity and transform the points gained in cash.

Here is what i usually do. I trade forex.

dollarPerPip = contracts * 100; % Here i calculate how much a pip worth in dollar, this value is true for EURUSD forex
cpnl = cumsum(pnl);
cpnl = (cpnl * dollarperPip) % Here transform pips in cash
cpnl = cpnl + initialEquity; % add the initialEquity
maxdd = maxdrawdown(cpnl); % calculate the max drawdown

If a strategy go under the required margin to trade, in my opinion, its not worth to calculate the max drawdown, so i discard.

I hope this helps.

$\endgroup$
1
  • $\begingroup$ Could you elaborate on why this works? $\endgroup$
    – Bob Jansen
    Jul 9, 2015 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.