95959f713c
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
930 B
930 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 | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| annualized_volatility | function | py | finance | 1.0.0 | pure | def annualized_volatility(returns: list, periods_per_year: float) -> float | Calcula la volatilidad anualizada de una serie de retornos. |
|
false |
|
false | python/functions/finance/finance.py |
Ejemplo
daily_returns = [0.01, -0.005, 0.008, 0.003, -0.002, 0.006, 0.004]
vol = annualized_volatility(daily_returns, 252.0)
# Volatilidad anualizada (std * sqrt(252))
Notas
Formula: std_muestral(returns) * sqrt(periods_per_year). Usa desviacion estandar muestral (n-1) para ser consistente con la practica financiera. Retorna 0.0 si hay menos de 2 retornos o periods_per_year es menor o igual a cero.