47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
43 lines
1.3 KiB
Markdown
43 lines
1.3 KiB
Markdown
---
|
|
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, pendiente-usar]
|
|
uses_functions: []
|
|
uses_types: [bollinger_result_go_finance]
|
|
returns: [bollinger_result_go_finance]
|
|
returns_optional: false
|
|
error_type: ""
|
|
imports: [math]
|
|
params:
|
|
- name: data
|
|
desc: "slice de precios de cierre (ej: [22.5, 23.1, 22.8, ...])"
|
|
- name: period
|
|
desc: "período de la media móvil simple (ej: 5, 20, 50 días)"
|
|
- name: numStdDev
|
|
desc: "número de desviaciones estándar para las bandas (típicamente 2.0)"
|
|
output: "tupla (upper, middle, lower) - tres slices de precios banda superior, media (SMA) e inferior"
|
|
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,
|
|
)
|
|
```
|