A self-adapting gold trading system that learns from every trade, verifies every decision, and refuses to act when it isn't sure.
BG Gold doesn't just execute a fixed strategy. It watches its own results, adjusts its filters, and builds a model of what actually works on this instrument — in this market — right now.
Every ten closed trades, the bot recalculates its ADX and EMA-spread gates from what actually won versus what lost. The bar for entry rises and falls with reality, not with a hardcoded number decided months ago.
After thirty trades, a LightGBM model trains on the full record of entry features — ADX, spread, MACD histogram, regime, direction, hour of day — and starts scoring every new signal with a win-probability estimate. If the score is below threshold, the trade doesn't happen.
The bot classifies every moment as Trending, Choppy, or Volatile based on ADX and ATR. Each regime carries different meaning for the same signal. The system knows the difference between a breakout and a false start.
The learning never stops. Each new closed trade adds context to the model. Every twenty trades after the first thirty, the classifier retrains itself against the full history. The bot you run tomorrow is measurably smarter than the one you ran today.
Precision isn't a feature.
It's the refusal to act when the odds aren't right.
Real trading has real failure modes. Orders get rejected. Positions get orphaned. Market data lags. BG Gold is engineered around those realities, not in denial of them.
Before firing, the bot re-reads positions from the broker. If anything is already open, the order is refused. If the read fails, the bot trusts its own cached state — and only proceeds when that state is flat.
Every order is issued through a typed direction enum — LONG or SHORT — never a bare string. The enum carries its own entry side, exit side, and reconciliation logic. Direction cannot be flipped by a typo.
Three seconds after firing, the bot re-reads the broker. If the fill is missing or the direction disagrees, the position is immediately closed and the bot halts. Retries up to three times with escalating delays.
Every cycle, the bot compares its internal direction against the broker's. If they diverge, it trusts the broker, blocks new entries, and waits for confirmation of flat before resuming.
Stop-loss and take-profit orders are attached to the position at the moment of entry — held on the broker's servers, not in the bot's memory. If the bot crashes, hangs, loses its connection, or is unplugged entirely, the trade still exits at the level it was placed at. The bot can go dark. The protection cannot.
APIs throttle. Networks drop. Services go down. A serious system doesn't hope those things away — it plans for them, redundantly.
Candle data is pulled from a primary feed. When that feed throttles, the bot silently switches to a secondary account with its own rate-limit budget. Two independent sources of truth for the same market.
A system-level watchdog checks the bot's heartbeat every five minutes. If the log goes stale or the process dies, the watcher kills the hung instance and starts a fresh one — automatically, within the recovery window.
A separate process polls open positions for peak-and-reversal patterns. If a winning trade gives back too much, the watcher closes it — regardless of what the main bot is doing. Two heads protecting the same capital.
When the broker signals rate-limit pressure, the bot backs off and waits. No retry storms. No cascading failures. The system treats throttling as information, not as an obstacle to overpower.
The system you trust with money shouldn't need to be watched.
It should be built to survive being left alone.
A private dashboard tracks the whole operation. Live PnL. Position state. Adaptive thresholds as they shift. The full log of every signal the bot evaluated — and every reason it chose to act or stand down.
Balance, drawdown, distance to the daily loss cap, and the consistency rule all tracked in one view. The prop firm's math, computed continuously, without manual reconciliation.
Win rate. Profit factor. Expectancy per trade. Max drawdown. R:R ratio. Every metric that separates a real edge from a lucky streak — computed from the complete trade log the moment you open the page.
Signal evaluations, order fires, position confirmations, closure accounting — all streamed in real time, in Pacific time, with automatic refresh and color coding for fast scanning.
A Groq-powered chat assistant lives inside the dashboard. Ask it to explain any part of the code, propose a patch, or diagnose a log entry. It reads the running source and returns staged, reviewable diffs.