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>
828 B
828 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 | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ema | function | go | finance | 1.0.0 | pure | func EMA(data []float64, period int) []float64 | Calcula la media movil exponencial (EMA) sobre una serie de datos con un periodo dado. |
|
false | false | functions/finance/ema.go |
ema
Calcula la media movil exponencial (Exponential Moving Average). Se inicializa con la SMA de los primeros period elementos. El multiplicador es 2 / (period + 1).
Ejemplo
result := finance.EMA([]float64{10, 11, 12, 13, 14, 15}, 3)
// result[2] = SMA de los primeros 3 = 11.0
// result[3] en adelante usa suavizado exponencial