Files
fn_registry/functions/finance/tick_to_ohlcv.md
T
egutierrez 113c6dfd71 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>
2026-03-28 02:23:31 +01:00

1.0 KiB

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
tick_to_ohlcv function go finance 1.0.0 pure func TickToOHLCV(prices, volumes []float64, timestamps []int64, intervalSecs int64) (open, high, low, close, vol []float64) Agrega datos de ticks en velas OHLCV segun un intervalo de tiempo en segundos.
finance
ohlcv
aggregate
tick
tick_go_finance
ohlcv_go_finance
ohlcv_go_finance
false
false
functions/finance/tick_to_ohlcv.go

tick_to_ohlcv

Agrega ticks (precio, volumen, timestamp) en velas OHLCV. Los ticks se agrupan en buckets de intervalSecs segundos. Los timestamps deben estar en unix seconds y ordenados cronologicamente.

Ejemplo

o, h, l, c, v := finance.TickToOHLCV(
    []float64{100, 101, 99, 102},
    []float64{10, 20, 15, 25},
    []int64{1000, 1005, 1055, 1060},
    60,
)
// Genera 2 velas: [1000-1059] y [1060-1119]