UNPKG

quant-zero

Version:

Node-Quant is a powerful Node.js package for developing and testing quantitative trading strategies in cryptocurrency markets, offering tools for backtesting and performance analysis.

16 lines (10 loc) 305 B
/** * Sharpe Ratio = E [Rp-Rf] / σp E = Expected value of Rp = return on a portfolio Rf = risk-free rate σp = standard deviation of the portfolio’s excess return */ export function calcSharpeE(E: number, rp: number, rf: number = 0, sp: number) { return (E * (rp - rf)) / sp; }