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:
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: normalize_ohlcv
|
||||
kind: function
|
||||
lang: go
|
||||
domain: finance
|
||||
version: "1.0.0"
|
||||
purity: pure
|
||||
signature: "func NormalizeOHLCV(open, high, low, close []float64, factor float64) ([]float64, []float64, []float64, []float64)"
|
||||
description: "Ajusta slices de precios OHLCV multiplicando cada valor por un factor dado."
|
||||
tags: [finance, ohlcv, normalize, adjust]
|
||||
uses_functions: []
|
||||
uses_types: [ohlcv_go_finance]
|
||||
returns: [ohlcv_go_finance]
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: []
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "functions/finance/normalize_ohlcv.go"
|
||||
---
|
||||
|
||||
# normalize_ohlcv
|
||||
|
||||
Ajusta slices de precios OHLCV (open, high, low, close) multiplicando cada elemento por un factor escalar. Util para ajustes por splits, conversiones de divisa, o normalizacion de series.
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
o, h, l, c := finance.NormalizeOHLCV(
|
||||
[]float64{100, 200},
|
||||
[]float64{110, 210},
|
||||
[]float64{90, 190},
|
||||
[]float64{105, 205},
|
||||
2.0,
|
||||
)
|
||||
// o = [200, 400], h = [220, 420], l = [180, 380], c = [210, 410]
|
||||
```
|
||||
Reference in New Issue
Block a user