feat: funciones Python para core, cybersecurity, datascience y finance
Agrega funciones Python reutilizables organizadas por dominio: - core: composicion funcional (pipe, compose, map, filter, reduce, etc.) - cybersecurity: analisis de amenazas y puertos - datascience: estadisticas y deteccion de outliers - finance: indicadores tecnicos y analisis financiero
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: bollinger_bands
|
||||
kind: function
|
||||
lang: py
|
||||
domain: finance
|
||||
version: "1.0.0"
|
||||
purity: pure
|
||||
signature: "def bollinger_bands(data: list, period: int, num_std: float) -> tuple"
|
||||
description: "Calcula las Bandas de Bollinger (upper, middle, lower) de una serie de precios."
|
||||
tags: [finance, bollinger, volatility, indicator, python]
|
||||
uses_functions: [sma_py_finance]
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: []
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "python/functions/finance/finance.py"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```python
|
||||
prices = [10, 11, 12, 13, 14, 15, 14, 13, 12, 11]
|
||||
upper, middle, lower = bollinger_bands(prices, 5, 2.0)
|
||||
# middle es la SMA(5), upper/lower son middle +/- 2*std
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Retorna tupla de tres listas (upper, middle, lower). Cada lista tiene len(data) - period + 1 elementos.
|
||||
La desviacion estandar se calcula sobre la ventana de tamanio period (poblacional, no muestral).
|
||||
Usa internamente la funcion sma para la banda media.
|
||||
Reference in New Issue
Block a user