eaed99e52c
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
749 B
749 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 | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| vwap | function | py | finance | 1.0.0 | pure | def vwap(prices: list, volumes: list) -> float | Calcula el Volume-Weighted Average Price (VWAP). |
|
false | false | python/functions/finance/finance.py |
Ejemplo
prices = [100.0, 101.0, 102.0, 101.5]
volumes = [1000, 1500, 1200, 800]
result = vwap(prices, volumes)
# 101.0888...
Notas
Formula: sum(price_i * volume_i) / sum(volume_i). Retorna 0.0 si las listas estan vacias, tienen distinto tamanio, o el volumen total es cero.