↓ Skip to main content

Bias-Aware Signal Classification for Supply & Demand Trading Systems


full title:

Bias-aware Signal Classification for Supply & Demand Trading Systems: A Comparative Study of Machine Learning Algorithms on XAUUSD
#

Author: Mohammad Mahdi Masoumian (Babol Noshirvani University of Technology)

Publisher/Release date: Posted: 20 Aug 2026 | Date Written: August 19, 2026

Download PDF

Abstract

Generating trading signals is straightforward; distinguishing high-quality signals from weak ones is not. This study applies a systematic machine-learning framework-XGBoost, Random Forest, and KNN-to filter raw signals generated by a rule-based supply-and-demand strategy on XAUUSD at the M5 timeframe. Signals were backtested under realistic transaction costs and labeled by realized return, and a novel mirroring-based methodology addressed the pronounced class imbalance between profitable and unprofitable outcomes. Hyperparameters were tuned via Bayesian optimization using the Sharpe ratio as the objective. Training data was further augmented with signals from eleven additional instruments-five forex pairs, four cryptocurrencies, and two commodities-so that models could still trade gold with a broader view of market behavior. XGBoost trained on this aggregated dataset achieved the best out-of-sample performance, reaching a Sharpe ratio of 2.02 and a return of 206.4% over the test period from March 2025 to August 2026.

Keywords: Algorithmic Trading, Financial Machine Learning, Quantitative Finance, Supply & Demand, Classification

citation:

Masoumian, M. M. (2026). Bias-aware Signal Classification for Supply & Demand Trading Systems: A Comparative Study of Machine Learning Algorithms on XAUUSD. SSRN Electronic Journal. https://doi.org/10.2139/ssrn.7316619