The Bot
AI Features
Three AI layers that filter, validate, and adapt every trade signal.
Overview
Every signal passes through three AI checks before an order is placed:
- 1
ML Signal Filter
Gradient-boosted classifier trained on your own trade history
- 2
Sentiment Analysis
News headlines scored — contradicting signals blocked
- 3
Volatility Prediction
GARCH + ATR percentile — skips low-vol, adjusts lot size in high-vol
1 — ML Signal Filter
A Gradient Boosted classifier trained on your closed trade history. It learns which market conditions and signal features actually produced wins on your specific account and broker — and blocks setups that historically lose.
Features the model uses:
Signal score (0–100) R:R ratio Session (London/NY/overlap) ADX at signal time RSI at signal time ATR ratio (normalised volatility) Strategy type Direction (buy/sell) Hour of day (UTC)
How it trains:
Every closed trade → outcome recorded to ai/model_cache/trade_history.csv After 30 trades → first model trained automatically Every 7 days → model retrained on latest history At inference → P(win) ≥ 55% required to allow trade
Note: The filter fails open — it allows all trades until 30 closed trades are recorded. It will never block trades due to a missing or broken model file.
2 — Sentiment Analysis
Pulls recent forex headlines from free RSS feeds every 30 minutes and scores them as bullish or bearish using keyword matching. Strong news that contradicts the trade direction is blocked.
Sources: ForexFactory RSS, FXStreet RSS, Yahoo Finance RSS
FinnHub API (optional — add token in settings.json)
Blocking rules:
Buy signal + sentiment score ≤ −0.4 → blocked (bearish news)
Sell signal + sentiment score ≥ +0.4 → blocked (bullish news)
Neutral range (−0.4 to +0.4) → trade allowedTo enable better news coverage, add a free FinnHub token:
{
"notifications": {
"finnhub_token": "your_free_token_from_finnhub.io"
}
}3 — Volatility Prediction
Predicts next-bar volatility using two methods combined: ATR percentile ranking (where is current ATR relative to the last 90 bars?) and a GARCH(1,1) one-step-ahead variance forecast.
| Regime | Condition | Effect |
|---|---|---|
| High vol | ATR > 75th percentile or GARCH ↑ | Lot size × 0.8 (protect from big swings) |
| Normal | ATR between percentiles | Lot size unchanged |
| Low vol | ATR < 25th percentile | Skip trade (spreads dominate thin markets) |
Tip: The AI features work best after 50+ closed trades. Run on a demo account for at least 2 weeks to build training data before switching to live.