first commit

This commit is contained in:
Francois Klieber committed 2021-06-06 20:25:14 +02:00
commit aa7869eb33
386 files changed
+69375

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
const stats = require('stats-lite');
const lodash = require('lodash');
// simply monkey patch the stats with other stuff we
// need and pass on.
// sharpe ratio
//
// @param returns (array - list of returns)
// @param rfreturn (number - risk free return)
//
stats.sharpe = (returns, rfreturn) => {
return (stats.mean(returns) - rfreturn) / stats.stdev(returns);
}
module.exports = stats;