vike-hl-cohort-backtest
vike-hl-cohort-backtest
Cohort positioning against price over history. A single --hours call returns hours x rungs rows (2160 hours of the 13-rung pnl axis is about 28,000 rows, 13 MB), so write each pull to a file and analyse it with code; never print it into the conversation. 1 credit per call.
Pull
vike-data hl cohort-metrics BTC --axis pnl --label-basis point_in_time --hours 2160 --json > btc_pnl_pit.json
vike-data hl cohort-metrics BTC --axis size --hours 2160 --json > btc_size.json
vike-data candles hl BTC --view export --interval 1h --start 2026-08-01T00:00:00Z --json > btc_1h.json # up to 5000 bars a call
Rows: ts (hour, UTC), cohort, total_position_value, total_position_value_long (USD notional), bias (fraction -1..+1). Newest hour first; page older hours with nextCursor -> --cursor. Candles: ts is epoch ms, left-aligned, the window half-open [start, end).
Whole-venue alternative (all symbols summed): vike-data hl segments --view history --cohort "3x smart" --axis pnl --hours 2160 --json (axis size or pnl; hours before 2026-04-07 are never returned; page back with --end = the oldest ts minus 1 second). Position-level history: hl market --view positions --symbol BTC --start ... rows carry label_causal, the previous hour's label.