---
name: tick_to_ohlcv
kind: pipeline
lang: go
domain: finance
version: "1.0.0"
purity: impure
signature: "func TickToOHLCV(ctx context.Context, symbol string, interval time.Duration) ([]OHLCV, error)"
description: "Pipeline que obtiene ticks de un exchange y los agrega en velas OHLCV."
tags: [pipeline, finance, ohlcv, ticks]
uses_functions: [fetch_ticks_go_io, aggregate_ohlcv_go_finance]
uses_types: [ohlcv_go_finance, tick_go_finance]
returns: [ohlcv_go_finance]
returns_optional: false
error_type: "error_go_core"
imports: []
params:
  - name: ctx
    desc: "contexto de ejecución con timeout/cancelación"
  - name: symbol
    desc: "par de trading (ej: BTCUSDT)"
  - name: interval
    desc: "duración de cada vela (ej: 5m, 1h)"
output: "slice de velas OHLCV agregadas, o error si falla el fetch"
tested: false
tests: []
test_file_path: ""
file_path: "functions/pipelines/tick_to_ohlcv.go"
---

## Ejemplo

```go
candles, err := TickToOHLCV(ctx, "BTCUSDT", 5*time.Minute)
```

## Notas

Pipeline impuro: orquesta fetch_ticks (IO) y aggregate_ohlcv (pura).
