A gold reinforcement learning bot hit 60% out-of-sample returns, so I stress tested it to find out whether it found a real edge or just got lucky.
This video walks through the full build-and-test logic behind the agent, from the reward function to the sliding-window evaluation setup. I also show why a model with 86% training returns can still collapse to 6.9% on unseen data, and how I filter for something more believable.
What you’ll see in this video:
→ how the gold reinforcement learning agent is structured
→ the buy sell hold action space with ATR-based risk management
→ the reward function and why it shapes the bot’s behavior
→ the sliding window and anchored walk-forward testing logic
→ how I select checkpoints without trusting overfit models
→ the out-of-sample backtest result and consistency gate
→ the final stress test logic for deciding if the edge is real
╔═╦═╦═╦═╦═╦═╦═╦═╦═╦═╦═╦═╦═╦═╦═╦═╦═╦══╦═╦═╦══╦═╦═╦══╦═╦═╦
🔗 Resources & Links:
————————————–
• My Algorithmic Trading Courses → https://codetradingcafe.com
• CoinQuant No Code Backtesting Platform: https://app.coinquant.ai/?ref=nZtzOwut
• My Book: “Algorithmic Trading with Python” → https://a.co/d/6woMBHt
• The project repo: https://github.com/ZiadFrancis/Reinforcement_Trading_Part_2
Happy learning, happy coding ☕
╚═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩═╩
0: 00 Gold Bot Out-Of-Sample
1: 06 The RL Agent Setup
2: 13 Sliding Window Testing
3: 48 Reward Function Design
7: 12 Checkpoint Model Selection
10: 04 Consistency Gate Filter
11: 01 Unseen Test Results
12: 02 Overfitting Model Warning
#aitrading #reinforcementlearning #goldtrading