sharpe_ratio
Function Name: sharpe_ratio
Tags: None
Category: Other
A ratio developed by Nobel laureate William F. Sharpe to measure riskadjusted performance. The Sharpe ratio is calculated by subtracting the riskfree rate (such as that of the 10year U.S. Treasury bond in USA or
German government bills or Euribor rates in EU)
from the rate of return for a portfolio and dividing the result by the standard deviation of the portfolio returns. The Sharpe ratio formula is:
SR = E(RRf)/s(RRf),
where: R: asset return,
Rf: return on a benchmark asset, such as the risk free rate of return,
E[R  Rf]: expected value of the excess of the asset return over the benchmark return and
s(RRf): standard deviation of the excess of the asset returns
Function usage: sharpe_ratio(Period, RiskFreeReturn, BarsPerYear) where: Period: number of bars to use in analysis. RiskFreeReturn: return on a benchmark asset, such as the risk free rate of return (such as that of the 10year U.S. Treasury bond in USA or
German government bills or Euribor rates in EU). The value should be given in %, per annum. BarsPerYear: custom number of bars per year. Used only if UseCustomBarsPerYear is set to true. UseCustomBarsPerYear: if true, BarsPerYear parameter is used. Otherwise the value is automatically calculated: 12 for monthly, 52 for weekly, 250 for daily.
Author: William F. Sharpe
Links: http://www.stanford.edu/~wfsharpe/art/sr/sr.htm, http://en.wikipedia.org/wiki/Sharpe_ratio, http://www.investopedia.com/terms/s/sharperatio.asp
Period 
Number of bars to use in analysis 

Default Value: 100  Minimum: 0  Maximum: 100000 

Type: Numeric 
RiskFreeReturn 
in %, per annum 

Default Value: 1.2509999999999999  Minimum: 0  Maximum: 100 

Type: Numeric 
BarsPerYear 
Used only if UseCustomBarsPerYear set to true, otherwise automatically calculated 

Default Value: 250  Minimum: 12  Maximum: 360000 

Type: Numeric 
UseCustomBarsPerYear 
If true, BarsPerYear parameter is used. Otherwise the value is automatically calculated: 12 for monthly, 52 for weekly, 250 for daily. 

Default Value: 0 

Type: Boolean 