Skip to main content

sharpe

Macro sharpe 

Source
macro_rules! sharpe {
    ($series: expr, $rf: expr) => { ... };
    ($rp: expr, $rf: expr, $sd: expr) => { ... };
}
Expand description

§Sharpe ratio

§Formula:

sharpe = (mean risk - risk free return) / std deviation of mean risk

§Usage

  1. sharpe!(series, rf);
  2. sharpe!(rp, rf, sd);

where: series: &[f64] - portfolio return as slice Item = % return (not absolute return) rf: f64 - risk free return rp: f64 - portfolio return sd: f64 - standard deviation

§Grading Thresholds

    Less than 1: Bad
    1 – 1.99: Adequate/good
    2 – 2.99: Very good
    Greater than 3: Excellent

ref: Sharpe Ratio