The Sharpe Ratio shows an adjusted measure of return by comparing the instrument price performance to a risk-free return. On this site we use the 13 week Treasury (IRX.X) and our calculation is the ex-post one.
. first get the Monthly Change % for each of the months
. get the Monthly Closes for the 13 week treasury (IRX.X on Profitspi.com)
. prorate the annual IRX.X rates to monthly
. calculate the excess return over treasury for each month
. calculate the SMA(12) and SDV(12) of the excess
. finally ratio = SMA / SDV * Sqrt(12)
Likewise for daily and weekly ratios we would adjust the treasury rates according to the period. And use sqrt of 252 and 52 respectively to annualize the final result.
The default setting is 252 daily bars but 36 monthly bars is also commonly used.