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>
746 B
746 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 | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| sma | function | go | finance | 1.0.0 | pure | func SMA(data []float64, period int) []float64 | Calcula la media movil simple (SMA) sobre una serie de datos con un periodo dado. |
|
false | false | functions/finance/sma.go |
sma
Calcula la media movil simple (Simple Moving Average). Los primeros period-1 elementos del resultado son 0 ya que no hay datos suficientes para calcular la media.
Ejemplo
result := finance.SMA([]float64{1, 2, 3, 4, 5}, 3)
// result = [0, 0, 2, 3, 4]