algorembrant's picture
Upload 61 files
9cb5a00 verified
"""
ML-3m-trader Configuration
===========================
Central configuration for all tunable parameters.
"""
import os
# ---------------------------------------------------------------------------
# Symbol & Timeframe
# ---------------------------------------------------------------------------
SYMBOL = "XAUUSDc"
TIMEFRAME_MINUTES = 3 # 3-minute bars
# ---------------------------------------------------------------------------
# Data
# ---------------------------------------------------------------------------
DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
MODEL_DIR = os.path.join(os.path.dirname(__file__), "models")
RESULTS_DIR = os.path.join(os.path.dirname(__file__), "results")
LOOKBACK_DAYS = 365 # 1 year of data
# ---------------------------------------------------------------------------
# Feature Parameters
# ---------------------------------------------------------------------------
SMA_FAST_PERIOD = 14
SMA_SLOW_PERIOD = 50
VROC_PERIOD = 14
ADX_PERIOD = 14
MOMENTUM_SI_PERIOD = 10
VIX_PROXY_PERIOD = 20 # rolling std of log-returns
# ---------------------------------------------------------------------------
# Labeling
# ---------------------------------------------------------------------------
ATR_PERIOD = 14
ATR_SL_MULTIPLIER = 1.5 # SL = ATR * multiplier
LABEL_LOOKAHEAD_BARS = 60 # max bars to wait for TP/SL hit (3h at 3m)
RR_RATIO = 1.0 # risk-reward ratio (1:1)
# Labels (integer encoding)
LABEL_DO_NOTHING = 0
LABEL_BUY = 1
LABEL_SELL = 2
LABEL_HOLD = 3
LABEL_NAMES = {
LABEL_DO_NOTHING: "DO_NOTHING",
LABEL_BUY: "BUY",
LABEL_SELL: "SELL",
LABEL_HOLD: "HOLD",
}
# ---------------------------------------------------------------------------
# Execution / Risk
# ---------------------------------------------------------------------------
SPREAD_FILTER_MULTIPLIER = 10 # skip if sl_distance < spread * 10
SLIPPAGE_MIN = 0.0 # min random slippage (XAUUSDc units)
SLIPPAGE_MAX = 2.0 # max random slippage (XAUUSDc units)
DEFAULT_BET_PCT = 0.02 # 2% of balance per trade
STARTING_BALANCE = 10_000.0 # USD
# ---------------------------------------------------------------------------
# Model Hyperparameters (LightGBM)
# ---------------------------------------------------------------------------
LGBM_PARAMS = {
"boosting_type": "gbdt",
"objective": "multiclass",
"num_class": 4,
"metric": "multi_logloss",
"num_leaves": 63,
"max_depth": 8,
"learning_rate": 0.05,
"n_estimators": 500,
"subsample": 0.8,
"colsample_bytree": 0.8,
"min_child_samples": 20,
"class_weight": "balanced",
"random_state": 42,
"verbose": -1,
"n_jobs": -1,
}
EARLY_STOPPING_ROUNDS = 30
TRAIN_SPLIT_RATIO = 0.80 # chronological 80/20
# ---------------------------------------------------------------------------
# Random Seed
# ---------------------------------------------------------------------------
RANDOM_SEED = 42