I come from a programming background and not am no quant by career so this is probably a newbie question for you guys. I have written some code to pull daily closing values for market indices (DOW/NASDAQ etc.) along with closing account balances from a stock broker's API.

enter image description here

See screenshot

So I have a date column, closing values for DJI/NASDAQ and 'ClosingBalance' for the day of a given trader's account. If I am to ignore the 'Deposit' and 'Withdrawal' columns, then I can take this time series and plot on a chart how the trader's account value is moving with the market for a given date range. I can then further compute if he is outperforming or not, etc. etc.


But turns out, the fellow might inject more equity via cash deposits over time or make withdrawals over time. Let's even forget withdrawals if it makes the scenario simpler, so in the case of just deposits (such as the 499 entry in the middle), what is the standard industry convention on adjusting against this while attempting to compute the trader's account balances vs. the market to see if he is outperforming?

Is it simple enough that when a deposit is made, you add up the same deposit for all previous days? And what happens when withdrawals are made?

Any hints on the usual direction programmers and quants take in this scenario will be helpful. Coding the logic isn't my problem, I want to understand what the practice to handle this situation is...

Also, how is the Y axis normalized here? The account balances could be in the 10k-100k range while the Dow could be in ther 15k-20k range while the NASDAQ could be in the 1k-5k range. Perhaps some kind of modular operation? Or divide or reduce by a factor? Perhaps pick one of the series' first value as the starting point on the scale, and subtract the other series by the difference so that all the series start at the same value? I suppose while plotting on a chart, the Y axis would really need to be a percentage scale and not absolute?...

OP EDIT BEGIN - This is my first draft after I coded things up

The green is my fund performance, blue is the DOW, black is the NASDAQ.

enter image description here




3 Answers 3


Maybe the following guidelines help:

  • Big picture: For performance measurement purposes you should compare returns not absolute values. You need to convert all time series into percent returns which in itself takes care of normalization. Also as next step you do not only want to measure out or under performance in terms of return performance but in risk-adjusted performance.

I would proceed as follows:

I make the following assumption: The closing balance reflects deposits/withdrawals(d/w) made on that day and the d/w has been undertaken post trading. Another assumption made is that investment performance is based on the total account balance, meaning that new deposits are invested on the next day, too. If those assumptions are incorrect then more information have to be given to be more specific. End Edit

  • First, adjust the account balance time series for withdrawals and deposits: Subtract deposits from that day'closing balance and add withdrawals back to that day's closing balance. You do not want to calculate returns on a deposit or withdrawal that has been made post trading. Next, calculate the daily percentage returns. Subsequently, adjust back the correct closing balance, reflecting deposits and withdrawals.

  • Then you can head into several different directions:

    • For each date sum up all previous returns for each individual time series which gets you a very simplified kind of aggregate performance series, you can then compare directly with the index performance (a geometric mean would be more accurate but this is just a simplified example)

    • Simply average the returns of each time series and compare results

    • Calculate the Sharpe Ratio for each time series and compare the average risk-adjusted returns (a search on this forum should show how to calculate SR)

    • Calculate for each data point the daily return and risk adjust it by dividing by the standard deviation that is sampled over a defined window. That will also get you a performance curve but on a risk adjusted basis.

As you can see there are many different ways (and probably a dozen more), so it really depends what you exactly indent to measure.

  • $\begingroup$ Just like the OP, I am a software developer, not a quant, but I still disagree with the following: "First, adjust the account balance time series for withdrawals and deposits: Subtract deposits from all subsequent account balances and add withdrawals back into all subsequent account balances to get account balances that only reflect trading performance." Consider the following scenario: Balance on day 1 is 30,000. Withdrawal on day 2: 29,000. Balance after day 2: 2,000. That means the absolute return on day 2 is 1,000. If you would add the 29,000 that had been withdrawn, you would get [cont] $\endgroup$ Aug 8, 2013 at 6:27
  • $\begingroup$ a performance of about 3.33% (30,000 --> 31,000) when in fact the performance was 100% (1,000 --> 2,000) $\endgroup$ Aug 8, 2013 at 6:29
  • $\begingroup$ Unless I have overlooked something no assumption was made how the closing account balance reflects deposits and withdrawals and thus I made the assumption that it was adjusted higher by deposits and lower by withdrawals and that d/w are made post trading each day. Will edit to be more specific about the assumptions. Thanks for pointing out. $\endgroup$
    – Matt Wolf
    Aug 8, 2013 at 7:19
  • $\begingroup$ Applied the suggestions, normalized deposits/withdrawals. Original post has an img of what I have now. As far as your second part about measuring performance of my fund against the DOW goes for instance, why isn't it as simply as "if on Jan 1 the DOW was at 1000 and on Jan 31 it was at 1100, that index rose 10%, and if my fund was 1000 in the beginning and 1200 in the end, mine rose 20%...? I lost it when you talked about 'summing up daily returns', 'risk adjustment' and involving the 'sharpe ratio'? What am I missing out on if I just say my fund rose 20% over the month when the DOW rose 10%? $\endgroup$ Aug 12, 2013 at 2:35
  • 1
    $\begingroup$ a) because what if you deposited 200 throughout the year (and had in no way accounted for that) then you would not have generated a return 20% but of 0%. b) What if your fund rose 20% but with a maximum drawdown of 50% and wild swings while the Dow returns were very steady with low variations? A case can be made that some may prefer to invest in the Dow even though it yields less. Can you imagine that there are people who are offered but reject to play a game to either win 1 mln USD with a probability of 99% or lose their lives with 1% probability? You need to build risk into your equation. $\endgroup$
    – Matt Wolf
    Aug 12, 2013 at 3:55

I can't speak as to whether it is "industry convention," but you might find Unit valuation useful here.


Accurate performance reporting is an important subject. The amount and timing of monies in an account is just one of the aspects affecting the performance. Others include taxes, fees, day count convention and benchmark construction.

One of the frameworks often referenced for that matter are the Globale Investment Performance Standards (GIPS). The standards are available for download.


Your Answer

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

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