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,34 @@
|
||||
---
|
||||
name: bollinger_bands
|
||||
kind: function
|
||||
lang: go
|
||||
domain: finance
|
||||
version: "1.0.0"
|
||||
purity: pure
|
||||
signature: "func BollingerBands(data []float64, period int, numStdDev float64) (upper, middle, lower []float64)"
|
||||
description: "Calcula las bandas de Bollinger (upper, middle, lower) para una serie de precios."
|
||||
tags: [finance, indicator, bollinger, bands]
|
||||
uses_functions: []
|
||||
uses_types: [bollinger_result_go_finance]
|
||||
returns: [bollinger_result_go_finance]
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: [math]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "functions/finance/bollinger_bands.go"
|
||||
---
|
||||
|
||||
# bollinger_bands
|
||||
|
||||
Calcula las bandas de Bollinger. La banda media es la SMA, y las bandas superior e inferior estan a `numStdDev` desviaciones estandar de la media. Usa desviacion estandar poblacional.
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
upper, middle, lower := finance.BollingerBands(
|
||||
[]float64{22, 24, 23, 25, 26, 28, 27, 29, 30, 28},
|
||||
5, 2.0,
|
||||
)
|
||||
```
|
||||
Reference in New Issue
Block a user