Update: Sharpe and standard deviation added to EzBacktest, released today at version 0.9.3
While adding the risk measurement feature to EzBacktest, I'm reviewing several risk measurements and samples. If anyone has an opinion, please leave a comment:
Investopedia: Modern Portfolio Theory Stats Primer, Also: Measure Your Portfolio's Performance
Some blog: Calculate Your Own Portfolio’s Standard Deviation
Wikipidia: Sharpe ratio
Another blog, with an excel sheet: Risk Adjusted Return - Sharpe Ratio using MS excel sheet free
OK, so here's where things stand: I'm a bit confused. Generally - you'd calculate the standard deviation using years of sample data - however, you might only be presented with 1, 2 years or just months worth of data. The excel sample uses annualized std of monthly returns - which I ran through code - and it isn't the same as yearly. Also, some document the expected ratio as calculated from AVERAGE yearly returns, others from ANNUALIZED yearly returns. And I need to add that ANNUALIZED MONTHLY AVERAGE returns are simply completely different.
So there you have it, the feature is nearly complete - but I'm left with some statistical doubt regarding the results.