Files
foxhunt/scripts/build_2q_fxcache.sh
jgrusewski 55ffe2b26f scripts(alpha): rename + add cross-quarter validation pipeline
- New scripts/alpha_pipeline.sh: orchestrates the 2-quarter validation
  after fxcache lands. Auto-discovers the Q1+Q2 fxcache (newest
  .fxcache excluding the known Q1-only hash), trains
  alpha_train_stacker on it, then sweeps 4 conditions
  (baseline / +cost-rand / +regime-scale / +both) × 3 walk-forward
  folds, aggregating mean ± stddev Sharpe per cost across folds.
  No phase prefixes in name or contents — the script is meant to
  outlive any single milestone.

- scripts/build_2q_fxcache.sh: fix staging layout so MBP-10 / trades
  / OHLCV symlinks live in the symbol subdir (`mbp10/ES.FUT/...`)
  that precompute_features expects. Previous flat-layout build
  aborted with "MBP-10 directory not found: .../mbp10/ES.FUT".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 00:42:07 +02:00

41 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build a Q1+Q2 2024 combined fxcache for cross-quarter walk-forward CV.
#
# Requires:
# test_data/futures-baseline/ES.FUT/ES.FUT_2024-Q1.dbn.zst (present)
# test_data/futures-baseline/ES.FUT/ES.FUT_2024-Q2.dbn.zst (present)
# test_data/futures-baseline-mbp10/ES.FUT/ES.FUT_2024-Q1.dbn.zst (present)
# test_data/futures-baseline-mbp10/ES.FUT/ES.FUT_2024-Q2.dbn.zst (download in progress)
# test_data/futures-baseline-trades/ES.FUT/ES.FUT_2024-Q1.dbn.zst (present)
# test_data/futures-baseline-trades/ES.FUT/ES.FUT_2024-Q2.dbn.zst (present)
#
# Produces a single fxcache + norm_stats in test_data/feature-cache/.
# Cache key is SHA256 over all matching DBN files in the input dirs.
set -euo pipefail
# Stage Q1+Q2 only — symlink them into a temporary dir so the builder
# doesn't pick up other quarters that may land later.
STAGE="${STAGE:-/tmp/fxbuild_2q_2024}"
rm -rf "$STAGE"
mkdir -p "$STAGE"/{ohlcv,mbp10,trades}/ES.FUT
for q in Q1 Q2; do
ln -s "/home/jgrusewski/Work/foxhunt/test_data/futures-baseline/ES.FUT/ES.FUT_2024-${q}.dbn.zst" "$STAGE/ohlcv/ES.FUT/"
ln -s "/home/jgrusewski/Work/foxhunt/test_data/futures-baseline-mbp10/ES.FUT/ES.FUT_2024-${q}.dbn.zst" "$STAGE/mbp10/ES.FUT/"
ln -s "/home/jgrusewski/Work/foxhunt/test_data/futures-baseline-trades/ES.FUT/ES.FUT_2024-${q}.dbn.zst" "$STAGE/trades/ES.FUT/"
done
mkdir -p test_data/feature-cache
SQLX_OFFLINE=true cargo run -p ml --release --example precompute_features -- \
--data-dir "$STAGE/ohlcv" \
--mbp10-data-dir "$STAGE/mbp10" \
--trades-data-dir "$STAGE/trades" \
--output-dir test_data/feature-cache \
--symbol ES.FUT \
--yes
echo
echo "Built fxcaches in test_data/feature-cache/:"
ls -lh test_data/feature-cache/ | grep "$(date +%Y-%m-%d)" || ls -lh test_data/feature-cache/ | tail