Python 75.9%
TeX 24%
1# ================================================================2# Auteur : Simon-Pierre Boucher3# Contact : contact@spboucher.ai4# Projet : Prévision de volatilité réalisée multi-actifs5# (HAR-RV vs GARCH vs Machine Learning)6# Fichier : config.yaml7# Description : Configuration centrale du pipeline — univers d'actifs,8# fenêtres d'estimation, horizons, seeds, chemins.9# ================================================================1011api:12 base_url: "https://www.hfmarketdata.io"13 rate_limit_per_sec: 4 # requests per second (polite default)14 max_retries: 515 backoff_base_sec: 1.0 # exponential backoff: base * 2**attempt16 timeout_sec: 6017 page_limit: 100000 # max rows per request page (validated live)18 cache_dir: "data/raw" # parquet cache, one file per (asset, ticker, timeframe)1920# ---------------------------------------------------------------- universe21# Validated against /v1/{asset}/tickers on 2026-08-10.22# NOTE: BNB is NOT available in the API -> replaced by ADA.23universe:24 equity: # asset class in API: stock / etf25 - {ticker: SPY, asset: etf}26 - {ticker: QQQ, asset: etf}27 - {ticker: IWM, asset: etf}28 - {ticker: GLD, asset: etf}29 - {ticker: TLT, asset: etf}30 - {ticker: AAPL, asset: stock}31 - {ticker: MSFT, asset: stock}32 - {ticker: NVDA, asset: stock}33 - {ticker: JPM, asset: stock}34 - {ticker: XOM, asset: stock}35 fx:36 - {ticker: EURUSD, asset: fx}37 - {ticker: USDJPY, asset: fx}38 - {ticker: GBPUSD, asset: fx}39 - {ticker: USDCAD, asset: fx}40 - {ticker: AUDUSD, asset: fx}41 crypto:42 - {ticker: BTC, asset: crypto}43 - {ticker: ETH, asset: crypto}44 - {ticker: SOL, asset: crypto}45 - {ticker: ADA, asset: crypto} # BNB unavailable in API46 - {ticker: XRP, asset: crypto}47 futures: # continuous, back-adjusted (ratio)48 - {ticker: ES, asset: futures}49 - {ticker: NQ, asset: futures}50 - {ticker: CL, asset: futures}51 - {ticker: GC, asset: futures}52 - {ticker: ZN, asset: futures}5354predictors: # used as features only, not forecast targets55 index:56 - {ticker: VIX, asset: index}5758adjustment: # per asset class59 stock: adj_splitdiv60 etf: adj_splitdiv61 futures: contin_adj_ratio62 crypto: none63 index: none64 fx: none6566sample:67 start: "2013-01-01" # common start (BTC begins 2013-04)68 end: "2026-07-31"69 timeframes: ["1min", "5min"] # intraday inputs for RV70 trading_hours: # local exchange time as served by the API71 equity: {open: "09:30", close: "16:00"} # RTH only for RV72 futures: {open: "00:00", close: "23:59"} # near-24h; sessions handled in code73 fx: {open: "00:00", close: "23:59"} # Sun 17:00 -> Fri 17:00 ET74 crypto: {open: "00:00", close: "23:59"} # 24/7, day = calendar day UTC75 min_intraday_bars: 30 # drop days with fewer valid 1-min bars (equity RTH)7677realized_vol:78 base_frequency_min: 5 # headline RV: 5-min subsampled79 subsample_offsets: 5 # number of 1-min offset grids averaged80 kernel: parzen # realized kernel (BNHLS 2008)81 jump_test_alpha: 0.001 # BNS test size for jump detection82 annualization_days: 2528384models:85 har_lags: [1, 5, 22]86 garch:87 dists: ["normal"]88 rescale: true89 ml:90 seed: 2026081091 tuning: walk_forward # strict temporal CV92 n_splits: 493 feature_sets: ["har", "extended"]94 lstm: {seq_len: 22, hidden: 64, layers: 1, epochs: 50, patience: 8}95 transformer: {seq_len: 22, d_model: 32, heads: 4, blocks: 2, epochs: 50, patience: 8}9697evaluation:98 estimation_window_days: 100099 reestimation_freq_days: 22 # monthly100 horizons: [1, 5, 22]101 losses: ["qlike", "mse"]102 mcs_alpha: 0.10103 mcs_bootstrap: 5000104105robustness:106 subperiods:107 pre2020: ["2013-01-01", "2019-12-31"]108 covid: ["2020-01-01", "2020-12-31"]109 inflation: ["2021-01-01", "2022-12-31"]110 recent: ["2024-01-01", "2026-07-31"]111 window_sizes: [500, 1000, 2000]112 frequencies: ["rv1min", "rv5min_ss", "rkernel"]113114backtest:115 vol_target_ann: 0.10116 leverage_cap: 3.0117 tc_bps: 5.0118 tc_grid_bps: [0, 5, 10, 20]119 var_levels: [0.01, 0.05]120 risk_aversion: 5.0121122paths:123 raw: "data/raw"124 processed: "data/processed"125 figures: "figures"126 tables: "results/tables"127 reproduced: "results/reproduced"128129seed: 20260810130