Download config.py from AcyLa/volatility-predictive-model: direct link, hf CLI and curl.
- Browser
- Download file 4.54 kB
-
https://huggingface.co/AcyLa/volatility-predictive-model/resolve/main/config.py
- Command line
-
hf download hf://AcyLa/volatility-predictive-model/config.py
-
curl -L -o config.py https://huggingface.co/AcyLa/volatility-predictive-model/resolve/main/config.py
4.54 kB
| """ | |
| High-Volatility Asset Predictive Model Configuration | |
| Covers: Leveraged ETFs, VIX products, crypto miners, biotech, high-beta tech, single-stock futures | |
| Architecture: Nadaraya-Watson + Bollinger + LightGBM/LSTM ensemble | |
| """ | |
| from dataclasses import dataclass, field | |
| from typing import List, Dict | |
| class VolAssetConfig: | |
| # βββ Assets β highest volatility instruments on Yahoo Finance βββ | |
| # Leveraged ETFs (3x daily leverage β extreme volatility) | |
| # VIX products (volatility of volatility) | |
| # Crypto miners (3-5x Bitcoin's volatility) | |
| # Biotech (binary event-driven: FDA approvals, trial results) | |
| # High-beta tech (semiconductors, AI, growth) | |
| tickers: List[str] = field(default_factory=lambda: [ | |
| # ββ Leveraged ETFs (3x) ββ | |
| "TQQQ", # ProShares UltraPro QQQ (3x Nasdaq-100) | |
| "SQQQ", # ProShares UltraPro Short QQQ (-3x Nasdaq-100) | |
| "UPRO", # ProShares UltraPro S&P500 (3x S&P 500) | |
| "SPXU", # ProShares UltraPro Short S&P500 (-3x) | |
| "SOXL", # Direxion Semiconductor Bull 3x | |
| "TNA", # Direxion Small Cap Bull 3x | |
| # ββ VIX & Volatility ββ | |
| "UVXY", # ProShares Ultra VIX Short-Term Futures (1.5x VIX) | |
| "VIXY", # ProShares VIX Short-Term Futures | |
| # ββ Crypto Miners ββ | |
| "MSTR", # MicroStrategy (Bitcoin proxy, extreme vol) | |
| "MARA", # Marathon Digital (Bitcoin mining) | |
| "RIOT", # Riot Platforms (Bitcoin mining) | |
| "CLSK", # CleanSpark (Bitcoin mining) | |
| # ββ Biotech (binary event-driven) ββ | |
| "XBI", # SPDR S&P Biotech ETF (equal-weight, high vol) | |
| # ββ High-Beta Tech ββ | |
| "NVDA", # NVIDIA (semiconductor/AI leader, high beta) | |
| "AMD", # Advanced Micro Devices | |
| "TSLA", # Tesla (high beta, extreme swings) | |
| "PLTR", # Palantir (high-beta data/AI) | |
| "COIN", # Coinbase (crypto exchange, high vol) | |
| "APP", # AppLovin (high-beta adtech/AI) | |
| ]) | |
| primary_ticker: str = "TQQQ" | |
| period: str = "max" | |
| interval: str = "1d" | |
| # βββ Nadaraya-Watson βββ | |
| nw_bandwidth: float = 8.0 | |
| nw_lookback: int = 200 | |
| nw_envelope_mult: float = 1.5 | |
| # βββ Bollinger Bands βββ | |
| bb_windows: List[int] = field(default_factory=lambda: [20, 50, 100]) | |
| bb_std_mult: List[float] = field(default_factory=lambda: [2.0, 2.5, 3.0]) | |
| # βββ Indicator windows βββ | |
| rsi_windows: List[int] = field(default_factory=lambda: [7, 14, 21]) | |
| macd_fast: int = 12; macd_slow: int = 26; macd_signal: int = 9 | |
| atr_windows: List[int] = field(default_factory=lambda: [14, 21, 50]) | |
| stoch_windows: List[int] = field(default_factory=lambda: [14, 21]) | |
| ema_windows: List[int] = field(default_factory=lambda: [9, 21, 50, 100, 200]) | |
| sma_windows: List[int] = field(default_factory=lambda: [20, 50, 100, 200]) | |
| # βββ Labels βββ | |
| horizons: List[int] = field(default_factory=lambda: [1, 5, 21]) | |
| # 1-day, 1-week, 1-month | |
| classification_threshold: float = 0.04 # 4% move = directional (higher for vol assets) | |
| # βββ Walk-Forward βββ | |
| train_window: int = 756 # ~3 years trading days | |
| val_window: int = 126 # ~6 months | |
| test_window: int = 63 # ~3 months | |
| step_size: int = 126 # ~6 months rolling | |
| purge_gap: int = 21 # 1 month purge | |
| # βββ LightGBM βββ | |
| lgbm_params: Dict = field(default_factory=lambda: { | |
| "objective": "regression", "metric": "rmse", "boosting_type": "gbdt", | |
| "num_leaves": 127, "learning_rate": 0.01, "feature_fraction": 0.7, | |
| "bagging_fraction": 0.8, "bagging_freq": 5, "verbose": -1, | |
| "min_data_in_leaf": 50, "lambda_l1": 0.1, "lambda_l2": 1.0, | |
| "max_depth": -1, "n_estimators": 300, "early_stopping_rounds": 30, | |
| }) | |
| # βββ LSTM βββ | |
| lstm_seq_len: int = 60 | |
| lstm_hidden_size: int = 128 | |
| lstm_num_layers: int = 2 | |
| lstm_dropout: float = 0.2 | |
| lstm_learning_rate: float = 0.001 | |
| lstm_batch_size: int = 64 | |
| lstm_epochs: int = 10 | |
| lstm_patience: int = 10 | |
| # βββ Ensemble βββ | |
| ensemble_weights: List[float] = field(default_factory=lambda: [0.6, 0.4]) | |
| # βββ Output βββ | |
| model_dir: str = "vol_models" | |
| results_dir: str = "vol_results" | |
| cfg = VolAssetConfig() | |