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.
11 lines (9 loc) • 361 B
text/typescript
/**
* Alpha = R – Rf – beta (Rm-Rf)
R represents the portfolio return.
Rf represents the risk-free rate of return. Beta represents the systematic risk of a portfolio.
Rm represents the market return, per a benchmark.
*/
export function calcAlpha(r: number, rf: number = 0, beta: number, rm: number) {
return r - rf - beta * (rm - rf)
}