feat: 15 funciones finance — indicadores, riesgo e IO de mercado
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>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: annualized_volatility
|
||||
kind: function
|
||||
lang: go
|
||||
domain: finance
|
||||
version: "1.0.0"
|
||||
purity: pure
|
||||
signature: "func AnnualizedVolatility(returns []float64, periodsPerYear float64) float64"
|
||||
description: "Calcula la volatilidad anualizada a partir de una serie de retornos y la frecuencia de los periodos."
|
||||
tags: [finance, volatility, risk, annualized]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: [math]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "functions/finance/annualized_volatility.go"
|
||||
---
|
||||
|
||||
# annualized_volatility
|
||||
|
||||
Calcula la volatilidad anualizada como `stddev(returns) * sqrt(periodsPerYear)`. Usa desviacion estandar muestral (n-1).
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
vol := finance.AnnualizedVolatility([]float64{0.01, -0.02, 0.015, 0.005, -0.01}, 252)
|
||||
```
|
||||
Reference in New Issue
Block a user