Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

(Although this is perhaps a very simple question, math-wise, it still has me puzzled so it's okay to ask for help here I guess. I really need to understand this, so any help is appreciated)

First, assume the S&P100 market index has performed like this on the first 3 days of the month:

day   open      close     return (abs)    return (%)
1     574.19    562.51    -11.68          -2.03
2     564.56    570.72      6.16           1.09
3     571.99    572.93      0.94           0.16

In other words, "the market" went down $11.68 or -2.03% on day 1. Now asssume that I have bought and sold the following stocks on each of these 3 days:

day   stock     buy      sell    return (abs)    return (%)
1     HPQ       40.81    40.14    -0.67           -1.64
2     FDX       89.79    87.89    -1.90           -2.12
3     PEP       63.49    63.24    -0.25           -0.39

So on day 1, I bought and sold HPQ for a return of -$0.67 or -1.64%. I now want to calculate, in %, how my trades performed against the market:

day    market return (%)    my return (%)    excess return (%)
1      -2.03                -1.64             0.39  (-1.64 - -2.03)
2       1.09                -2.12             3.21
3       0.16                -0.39            -0.55
total  -0.78                -4.15            -3.37  (-4.15 - -0.78)

For instance, on day 1 the market went down 1.64% but the stock I bought only went down 1.64%. In other words, my trade "outperformed" the market by 0.39%. When totalling, the market lost 0.78% during the three days, but my trades lost -4.15%. The way I interpret this, my trades underperformed 3.37% against the market.

Alternatively, if I take the first (574.19) and last (572.93) price of the market indexfund, the market only declined ((572.93 - 574.19) / 574.19) * 100 = -0.22%. Based on this number, my trades underperformed the market by -3.37 - -0.22 = -3.15%

Question 1 How do the 2 market performances that I calculated (-0.78% and -0.22%) relate to each other?

Question 2 How do I correctly culculate the relative performance of my trades against the market? Is is -3.37% or -3.15%? And if it's neither, how do I calculate with how many % my trading outperformed (or underperformed) the market?

[edit after thinking about incorporating overnight returns]

day  stock  close@yesterday  open@today  close@today  return (abs)  return (%)
1    HPQ    40.00            40.81       40.14         0.14          0.35
2    FDX    90.00            89.79       87.89        -2.11         -2.34
3    PEP    64.00            63.49       63.24        -0.76         -1.19
---------------------------------------------------------------------------- +

(today's opening price is just there for reference. I've calculated return (abs) as close@today - close@yesterday and return (%) as (return (abs) / close@yesterday x 100))

share|cite|improve this question
up vote 3 down vote accepted

Normally the market return of a given day is calculated from the previous day's close, not from that day's open, so the return on day 2 is $570.72-562.51=8.21$ or When you add the returns on the three days you miss the rises in the index that happened overnight. This is why you get different returns by adding the return of the three days from taking the whole span. If you want to cover day 1 open to day 3 close, the $-0.22\%$ is correct. Similarly, you should calculate your return from purchase (presumably at market open day 1) to sale (market close day 3), but it should be based on the whole portfolio. On the assumption you bought the same dollar value of each stock, the portfolio performance is the average of the performances of the three stocks, not the sum. If you didn't buy the same amount, you need to weight the change by how much of each stock you bought. If you bought the same amount of each stock, your return is $-1.38\%$. Your excess return is then $-1.16\%$

share|cite|improve this answer
Thanks for your reply, it clarifies the difference in market returns for me. On my returns you say: "Similarly, you should calculate your return from purchase (presumably at market open day 1) to sale (market close day 3)". But the situation is slightly different: on day 1, I bought and sold HPQ for a return of -1.64%. Then on day 2 and 3, I respectively bought and sold FDX and PEP. So I only held each stock for 1 day. I believe this is a different situation from where I would have bought 1 stock and held it for the 3 days. Shouldn't return be the sum here instead of average? – Pr0no Aug 24 '12 at 23:52
@Pr0no: yes, if you took all the money and bought at the open and sold at the close, the total return is the sum of the three returns (more accurately, the product of 1+ the returns). Then you should be comparing to the within-day changes in the index, as you were out of the market overnight. So the index changed -0.78% and you underperformed by 3.37%. To be really fair, you should look up the index value at the moment you made the trades, but you have the idea. – Ross Millikan Aug 24 '12 at 23:59
I'm performing a simulation for my masters thesis. I have gathered the number of positive and negative tweets about all S&P100 companies for a period of 102 trading days. Each day, I buy and sell the stock which had the highest positive-negative tweet ratio in the previous 3 days. I want to see if such a trading strategy would "beat the market". So I buy when the market opens and sell when it closes. I do not hold stocks overnight. Could you please explain the "1 + the returns"? The actual total return would then be 1 + (-1.64) + (-2.12) + (-0.39) = 3.15 instead of 4.15? – Pr0no Aug 25 '12 at 0:10
@Pr0no: Let's use bigger numbers. If you gain 25% one day and lose 25% the next, you don't have the same amount of money left. You have 1.25*0.75=0.9375 times as much, for a loss of 6.25%. This depends on the product of two returns, so if they are very small compared to 100%, it doesn't matter. If it is +2% and -2%, you have 1.02*0.98=0.9996, so the error is small. – Ross Millikan Aug 25 '12 at 0:36
@Prono: Answer 1 is similar to my original, where it assumes you are in the market overnight. The question of summing percentages is as in my last comment. It is not correct, but is close when the products are small. You have it right in your second to last post, and the difference between 4.15% and 4.1% is the difference between adding and multiplying. bennyBC is making the same mistake I did in the answer, assuming you buy all three stocks on day 1 and hold them to day 3. We have ignored any gain you could get from the cash overnight. – Ross Millikan Aug 25 '12 at 2:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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