113c6dfd71
11 funciones puras con implementación real: SMA, EMA, RSI, BollingerBands, VWAP, LogReturn, AnnualizedVolatility, SharpeRatio, MaxDrawdown, NormalizeOHLCV, TickToOHLCV 4 funciones impuras (stubs): FetchOHLCV, StreamTicks, WriteOHLCVToParquet, LoadOHLCVFromDuckDB Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
799 B
799 B
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| sharpe_ratio | function | go | finance | 1.0.0 | pure | func SharpeRatio(returns []float64, riskFreeRate float64, periodsPerYear float64) float64 | Calcula el ratio de Sharpe anualizado a partir de retornos, tasa libre de riesgo y frecuencia. |
|
false |
|
false | functions/finance/sharpe_ratio.go |
sharpe_ratio
Calcula el ratio de Sharpe: (mean(returns) - riskFreeRate) / stddev(returns) * sqrt(periodsPerYear). Usa desviacion estandar muestral.
Ejemplo
sr := finance.SharpeRatio([]float64{0.01, 0.02, -0.005, 0.015, 0.008}, 0.0001, 252)