JonusNattapong commited on
Commit
c15f58a
·
verified ·
1 Parent(s): 8608c59

Upload MODEL_CARD.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. MODEL_CARD.md +63 -0
MODEL_CARD.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Model: Romeo (V5)
2
+ ==================
3
+
4
+ Short description
5
+ -----------------
6
+ Romeo (V5) is an ensemble trading model for XAUUSD that combines tree-based models (XGBoost / LightGBM) and an optional Keras neural network head. The ensemble outputs a probability score for an up / long trade; entry/exit logic and position sizing are handled by the backtester.
7
+
8
+ Model artifacts
9
+ ---------------
10
+ - `trading_model_romeo_daily.pkl` — joblib pickle containing tree models, model weights, and canonical `features` list.
11
+ - `romeo_keras_daily.keras` — optional Keras model file (if included during training).
12
+
13
+ Intended use
14
+ ------------
15
+ - Research, backtesting, and evaluation on historical XAUUSD data.
16
+ - Not financial advice. Use with caution and proper risk controls in production.
17
+
18
+ Model structure and transparency
19
+ --------------------------------
20
+ - Ensemble components:
21
+ - XGBoost classifier(s) and/or LightGBM classifiers stored inside the `.pkl` artifact.
22
+ - Optional Keras neural network stored in `.keras` format. The code replaces anonymous Lambda layers with a serializable `SumAxis1Layer` to ensure portability.
23
+ - Canonical feature list: stored under the artifact key `features`. Backtester aligns unseen data to that canonical list and fills missing features with zeros.
24
+
25
+ Backtest and evaluation assumptions
26
+ ----------------------------------
27
+ - Entry occurs on next bar open after a signal. Slippage is applied in pips and commission as a percent. TP/SL/timeouts are supported in the backtester.
28
+ - Metrics are computed using per-bar mark-to-market (M2M) equity when requested. This is the preferred risk measure and is reported in the `backtest_results_romeo/` outputs.
29
+
30
+ Recent evaluation (unseen daily data)
31
+ -----------------------------------
32
+ - initial_capital: 100
33
+ - final_capital: 484.8199412897085
34
+ - CAGR: 0.044435345346789834
35
+ - Annual volatility: 0.4118163868756299
36
+ - Sharpe: 0.31192432046397695
37
+ - Max drawdown: -0.47656310794093215
38
+ - Total trades: 3610
39
+ - Win rate: 0.49473684210526314
40
+
41
+ Robustness summary (coarse grid)
42
+ --------------------------------
43
+ See `backtest_results_romeo/romeo_robustness_summary.json` for the coarse grid scan. Best scenarios favored low friction (slippage and commission near zero) and a threshold around 0.5. Worst scenarios concentrated at higher commission (0.0005) and higher thresholds (0.6).
44
+
45
+ How to use
46
+ ----------
47
+ 1. Load artifacts:
48
+ - Load `trading_model_romeo_daily.pkl` with `joblib.load()`; this returns a dict with keys like `models`, `weights`, `features`, and optionally `keras_path`.
49
+ 2. Align data:
50
+ - Prepare features matching the canonical `features` list. Any missing features can be filled with zeros.
51
+ 3. Make predictions:
52
+ - For tree ensemble use `model.predict_proba(X)`. For Keras models use `keras.models.load_model()` with the `SumAxis1Layer` custom object if needed.
53
+ 4. Backtest:
54
+ - Use `v5/backtest_v5.py` which accepts `--data <path>` and will align features automatically.
55
+
56
+ Limitations and caveats
57
+ -----------------------
58
+ - Position sizing in the current backtester is simplified; small-account behavior may not reflect brokerage margin rules. Consider improving position-sizing (fixed risk per trade) before using live.
59
+ - These results are from historical backtests and are not a guarantee of future performance.
60
+
61
+ Contact
62
+ -------
63
+ For questions or to request model re-training or different artifact flavors, open an issue or contact the repository owner.