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:
2026-03-28 02:23:31 +01:00
parent 16e34a806e
commit 113c6dfd71
31 changed files with 830 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
---
name: vwap
kind: function
lang: go
domain: finance
version: "1.0.0"
purity: pure
signature: "func VWAP(prices, volumes []float64) float64"
description: "Calcula el Volume Weighted Average Price (VWAP) a partir de precios y volumenes."
tags: [finance, indicator, vwap, volume]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: ""
imports: []
tested: false
tests: []
test_file_path: ""
file_path: "functions/finance/vwap.go"
---
# vwap
Calcula el VWAP (Volume Weighted Average Price). Es la suma de (precio * volumen) dividida por la suma de volumenes.
## Ejemplo
```go
v := finance.VWAP([]float64{100, 102, 101}, []float64{500, 300, 200})
// v = (100*500 + 102*300 + 101*200) / (500+300+200)
```