Automated Trading System

Institutional-Grade
Multi-Asset
Trading Engine

A fully autonomous multi-strategy trading system spanning crypto perpetual futures, CME micro futures, and forex pairs. Donchian breakout, Connors RSI mean reversion, and cointegration pairs trading, validated across 15 years of market data. Built for resilience. Hardened in production.

3 Exchanges
Coinbase · IBKR · IG
4 Strategies
Breakout · MR · Pairs · Scanner
15yr
OOS Validated
50+
Edge Cases Handled
EXPLORE
Trading Strategies

Three Engines, One Platform

Each market gets the strategy that fits its structure. Crypto perpetuals run a 5-gate hourly breakout system. CME futures run a daily Donchian champion plus Connors RSI mean reversion. Forex pairs use 4H Connors RSI mean reversion plus z-score cointegration pairs trading.

ENGINE 1 — COINBASE CRYPTO

Five-Gate Hourly Breakout

  1. 1

    Donchian Breakout

    Price exceeds 8-bar high/low channel plus ATR buffer, confirming genuine range expansion

  2. 2

    ADX Trend Strength ≥ 28

    Average Directional Index confirms a trending market, filtering out ranging and choppy conditions

  3. 3

    EMA Alignment

    Fast EMA(9) and Slow EMA(21) confirm directional bias matches the breakout direction

  4. 4

    RSI Confirmation

    RSI > 55 for longs, RSI < 45 for shorts—momentum aligns with entry direction

  5. 5

    Higher-Timeframe Gate

    4-hour EMA(55) must align with trade direction—ensures macro trend agreement

Crypto Exit Management

🛑

Stop Loss

Hard bracket order on exchange

2.5× ATR
🎯

Take Profit

Bracket TP at 1.2R — primary profit exit (v5.8.0)

3.0× ATR
✂️

Partial Profit

50% position closed early

1.5R
🛡️

1.0R Profit Lock

SL moved to lock 1R profit (WebSocket sub-second)

@ 1.0R
📈

Trailing Stop

Follows price at 1.5 ATR via WebSocket — no profit ceiling

@ 2.0R
🔌

Exchange Bracket Sync

Bracket SL edited to match trailing level via WS — crash-safe

Live

Time Exit

Force close stale positions

15 bars
EXIT LIFECYCLE
SL @ 2.5 ATR WS detects 1R <2s → SL locked Partial 50% @ 1.5R TP pushed to 50× ATR WS trailing SL (real-time) TRAIL exit (no ceiling)
Since v5.8.0, the bracket TP fires at 1.2R (3×ATR / 2.5×ATR) as the primary profit exit. Parameter sweep across 183 crypto perpetuals confirmed TP3 outperforms TP5 (+30% vs +19% return, 36% vs 44% DD). WebSocket trade management detects 1.0R in sub-second time and locks the exchange SL to protect gains. TM code for partials, graduation, and trailing remains dormant but ready to activate if TP is ever widened.
v5.8.2 — DATA-DRIVEN
TP3 — Clean 1.2R Bracket Exit
Parameter sweep across 183 crypto perpetuals proved TP3 outperforms TP5: +30% vs +19% return, 36% vs 44% drawdown. Runner test (TP=999, no ceiling) confirmed crypto 1H doesn’t trend far enough for partials/graduation/trailing. Simple bracket exit at 1.2R captures the move before it retraces. TM code remains dormant, ready for future use.
Data-Driven Optimization 1.2R Sweet Spot Dormant TM Ready
POSITION SIZING
15% equity per position · 3 max slots + 1 reserved
Per-trade risk capped at 2% of account equity
Engine 2 — CME Futures

Champion Donchian +
Connors RSI Mean Reversion

939 parameter combinations tested across 39 products. One champion emerged with 100% hit rate. Out-of-sample validated across 15 years (2010–2026).

TREND FOLLOWING

Daily Donchian Breakout

  1. 1

    20-Day Channel Breakout

    Price exceeds 20-day high or low — pure Turtle Trading entry signal on daily bars

  2. 2

    SMA(200) Trend Gate

    Only long above the 200-day moving average, only short below — aligns with the macro trend

  3. 3

    TP 3×ATR / SL 2×ATR

    Key discovery: TP3 beats TP5 on 112 of 156 comparisons — captures the meat of the move before reversal

  4. 4

    6 Micro Futures

    MGC (Gold), SIL (Silver), MES (S&P), MNQ (Nasdaq), M2K (Russell), MYM (Dow) — all validated OOS

MEAN REVERSION

Connors RSI on Equity Indices

📉

RSI(3) Oversold Entry

Enter long when RSI(3) drops below 15 — extreme short-term exhaustion

RSI < 15
📊

Bollinger Band Touch

Price must touch lower BB(20,2) — confirms price is truly stretched

BB(20)
🛡️

SMA(200) Trend Gate

Only buy dips above the 200-day — avoids catching knives in bear markets

Bull only
🎯

SMA(10) Mean Exit

Exit when price crosses back above SMA(10) — mean reversion complete

SMA(10)
PORTFOLIO BACKTEST — $25K EQUITY
+701%
TOTAL RETURN
1.44
PROFIT FACTOR
-40%
MAX DRAWDOWN
370
TRADES
47.6%
WIN RATE
2.87
CALMAR RATIO
Dynamic 12-product universe (scanner-selected daily), max 6 simultaneous positions. 2020–2026 in-sample, OOS validated 2010–2019. 21 of 22 products profitable in both periods. Donchian contributes $155K, MR contributes $19K.
FUTURES POSITION SIZING
8% max risk per trade · 6 position slots · $25K allocation
Whole-contract sizing with margin checks. Skip trades where risk exceeds 3× budget.
Engine 3 — Forex

Connors RSI Mean Reversion +
Cointegration Pairs Trading

576 MR parameter combinations swept across 7 forex pairs. 1,944 pairs parameter combinations tested. Two complementary strategies on IG Markets demo, both validated OOS.

ENGINE 3a — MEAN REVERSION

4H Connors RSI + Bollinger Bands

  1. 1

    RSI(3) Oversold/Overbought

    Enter long when RSI(3) < 20, short when RSI(3) > 90 — extreme short-term exhaustion on 4H bars

  2. 2

    Bollinger Band Touch

    Price must touch lower/upper BB(20,2) — confirms price is truly stretched from the mean

  3. 3

    SMA(200) Trend Gate

    Only long above 200-SMA, only short below — trade with the macro trend, not against it

  4. 4

    SMA(3) Mean Exit

    Exit when price crosses back through SMA(3) — mean reversion complete, 95% of exits are clean

ENGINE 3b — PAIRS TRADING

Z-Score Cointegration

📊

Spread Z-Score Entry

Enter when spread z-score exceeds threshold — pairs are statistically mispriced

Z > 2σ
🎯

Mean Reversion Exit

Exit when z-score returns to zero — spread has normalized

Z → 0
🛡️

Rolling Hedge Ratio

30-bar OLS regression maintains dollar neutrality between legs

OLS β

Max Hold Exit

Force close if spread doesn’t revert within 25 bars

25 bars
MR BACKTEST — $20K EQUITY
+$5.4K
TOTAL P&L
5.87
CALMAR RATIO
-4.6%
MAX DRAWDOWN
362
TRADES
57.7%
WIN RATE
95%
MEAN EXITS
Champion: os20/ob90/exit3/bbT/sl3.0 on 4H bars. 6 forex pairs (USDCHF disabled, PF 0.86). 576 combos swept. Forex pairs mean-revert ~70% of the time. Donchian breakout FAILED on forex (37.5% WR, -$6K).
PAIRS BACKTEST — TOP 3 PAIRS
EUR/CHF
+$5,173
1H • Calmar 9.6
AUD/NZD
+$427
30M • Calmar 9.7
EUR/GBP
+$564
4H • Calmar 4.7
1,944 parameter combinations swept across 3 pairs × 3 timeframes × 216 params. Dollar-neutral legs via rolling OLS hedge ratio. All 3 pairs profitable with sub-3% drawdown.
FOREX POSITION SIZING
2% risk per MR trade · 4 max slots · $20K allocation each
Pairs: dollar-neutral sizing via hedge ratio. Max 3 concurrent pair positions.
14
Services Running
15yr
OOS Validated
65+
Bug Fixes Deployed
0
Manual Intervention
Regime Intelligence

GateKeeper — The System
That Reads the Room

Markets change character. Trends, ranges, and crises each demand different behaviour. GateKeeper classifies the regime for every engine, every four hours, using the native reference instrument each asset class actually responds to — then adjusts risk parameters automatically. No manual intervention. No guesswork.

🛡
PER-ENGINE REGIME DETECTION
CRYPTO
BTC
ADX trend strength on Bitcoin 4H candles. Crypto follows its own cycle — not equities.
4H CYCLE
🚀
FUTURES
MES
S&P 500 micro futures as the equity barometer. Daily bars — one classification per session.
24H CYCLE
💱
FOREX
DXY
Dollar index drives all major USD crosses. Aligned to London and New York session shifts.
8H CYCLE
↑ TREND UP ↔ RANGE ↓ TREND DOWN ⚠ CRISIS
📉
VIX CRISIS DETECTION
VIX spike above threshold triggers CRISIS across all engines. 48-hour cooldown prevents premature exit.
DEBOUNCE LOGIC
3 consecutive confirmations required before regime change. Prevents whipsaw from noisy ADX readings.
⚙️
ADAPTIVE RISK
Tighter stops in trending regimes. Slot limits adjusted per regime. Mean reversion paused in extremes.
📚
RESEARCH-BACKED
Architecture informed by 37 academic references on regime detection, evaluation frequency, and crisis response.

GateKeeper runs as a systemd timer every 4 hours (00:30, 04:30, 08:30, 12:30, 16:30, 20:30 UTC). State persists in JSON with transition history. The dashboard Command Center shows regime status, VIX gauge, live countdown to next scan, and full transition log — all in real time.

System Architecture

Fourteen Coordinated Services,
One Unified System

Every component runs as a managed systemd service with automatic restart, crash monitoring, and real-time alerting. Zero manual intervention required.

🤖
TRADING BOT
Core engine. Signal generation, order execution, position management. 60s REST cycle + WebSocket TM thread.
💹
IBKR ENGINE
Engine 2: CME micro futures. Daily Donchian + Connors MR. 12 dynamic products. IBKR Gateway via Docker.
💱
IG FOREX ENGINE
Engine 3a: Forex mean reversion. 4H Connors RSI(3) + BB. 6 pairs via IG Markets REST API.
🔗
PAIRS TRADING
Engine 3b: Z-score cointegration on 3 forex pairs. Rolling OLS hedge ratio. Dollar-neutral legs.
🔍
UNIVERSE UPDATER
Discovers trending assets via ADX/ATR/volume scanning + mini-backtest validation.
📅
IBKR UNIVERSE
Daily 22:30 UTC scan of 113 futures symbols. 8-step pipeline: resolve, filter, rank. 12 dynamic products selected.
📊
PERF TRACKER
Rolling performance stats. Auto-pauses products that underperform.
📱
TRADE ALERTS
Real-time Telegram notifications for entries, exits, and critical events.
🛡️
CRASH MONITOR
Watches bot process. Auto-restarts on crash. Escalates persistent failures.
📈
DASHBOARD
WebSocket-powered real-time UI. Equity, positions, scanner, WS status badge.
📨
DAILY SUMMARY
Automated daily P&L report via Telegram at midnight UTC.
🔔
LOG WATCHER
Tails all service logs for WARNING/ERROR/CRITICAL. Telegram alerts with 1hr dedup.
Risk Controls

Seven Layers of Protection

Every layer operates independently. A failure in any single layer cannot cascade—the remaining six continue protecting capital.

01

Exchange Bracket Orders

Hardware stop-loss and take-profit orders live on-exchange. Execute even if the bot is completely offline. The ultimate backstop.

02

Per-Trade Risk Cap

Every position size is clamped so that (size × SL distance) / equity never exceeds 2%. Prevents outsized risk on high-volatility assets.

03

Software Trade Management

1R locks, partial exits, and trailing stops run sub-second via WebSocket price feed. Time-based exits and bracket detection run every 60 seconds via REST fallback. 5-attempt retry with exponential backoff on failures.

04

Phantom Exit Protection

If the exchange API returns zero positions while the bot tracks active ones, the cycle is skipped entirely. Prevents catastrophic state wipe from transient API glitches.

05

Performance-Based Pausing

Products that hit negative R thresholds are automatically paused. Re-reads from disk each cycle so pauses can never be silently overwritten.

06

Multi-Layer Volume Gating

7-day average daily volume must exceed $2M, plus a 4-hour short-window check catches faded pump-and-dumps. All checks use USD notional, never raw base units.

07

Critical Alert Escalation

Failed close attempts, orphaned positions, and API errors trigger immediate Telegram alerts with priority escalation for human review.

Capabilities

Built for the Real World

Not a weekend project. This is a production system with 50+ edge cases identified and resolved through live market experience.

🌐

Dynamic Universe

Hybrid mode combines core assets with algorithmically discovered trending products. Every candidate must pass ADX/ATR/volume screens AND a mini-backtest before admission.

📱

Real-Time Dashboard

WebSocket-powered monitoring with live equity curve + drawdown overlay, per-product breakdown, scanner with breakout levels, trade history, and 9-stat metrics grid. PWA-enabled for mobile.

🔎

Market Scanner

Five-condition entry checklist across all universe products. Color-coded signal dots show exactly how close each market is to triggering. Scan on demand or auto-refresh.

🧪

Backtesting Engine

Full strategy simulation with realistic fees, slippage, and risk-capped position sizing. Multiprocessing parameter sweep (--workers N) for parallel optimization across market regimes.

Atomic State Safety

All state writes use write-to-temp-then-rename with backup files. fcntl advisory locking prevents concurrent read-modify-write races between services. Crash-proof.

🌍

Multi-Strategy Portfolio

Trend-following on commodities and crypto, mean reversion on equity indices. Strategies are anti-correlated — MR profits in bulls, Donchian profits in bears. Asset class diversification across metals, energy, equities, and crypto.

Production Hardening

Battle-Tested Through
Live Market Exposure

Every fix below was discovered through real trading, not theoretical review. The system gets stronger with every edge case encountered.

v6.2.0 — REGIME INTELLIGENCE
GateKeeper Phase D + Command Center Dashboard
Per-engine regime detection (BTC/MES/DXY) with 4H evaluation cycle. Dashboard v4.5.0: GK Command Center with VIX gauge, regime transition history, live countdown timer. Particle background adapts colour to market regime. TV mode for wall monitors. Per-engine debounce prevents regime whipsaw.
v6.1.0 — REGIME DETECTION
GateKeeper: Market Regime Awareness
Global regime detector using SPY ADX + VIX. Per-engine classification in Phase D: crypto follows BTC trends, futures track MES, forex monitors DXY. Crisis detection via VIX with 48H cooldown. 37 academic references validating the approach. Systemd timer-based evaluation.
v6.0.0 — MARKET REGIME
GateKeeper: Global Regime Detector
Global regime detector with SPY ADX + VIX crisis detection. Systemd timer service. State file persistence. Dashboard GK banner with per-engine badges. Debounce logic (24H hold, 3 confirm bars, 48H crisis cooldown). Research doc with 37 academic references.
v5.8.2 — UI POLISH
Pulse Pills Dashboard + Engine 3 Integration
Dashboard v4.3.3 sprint. Pulse pills replace status strip. E2/E3 equity curves. Pairs config display. 401 auto-reconnect on IG client. 30-min heartbeat on all non-crypto bots. Silent file-only logging across all engines.
v5.8.1 — OPTIMISATION
IBKR Time Exit Sweep + Cleanup
Time exit 72→15 bars validated by 9-value sweep across 6 micro futures (2019-2026). +119% vs +16.5% return. Ejects stalled dead money 28% faster. Dashboard dormant TM lights removed. Backtest partial-TP guard added.
v5.8.0 — STRATEGY
TP3 Champion Configuration
tp_atr_mult 5.0→3.0. Sweep across 183 crypto perpetuals confirmed TP3 (+30%, 36% DD) outperforms TP5 (+19%, 44% DD). Bracket TP fires at 1.2R. Partials, graduation, and trailing dormant — bracket fires first. TM code preserved for future reactivation.
v5.7.9 — RELIABILITY
Telegram Noise Filter
Log watcher NOISE_PATTERNS list suppresses WS reconnect floods (97 per session), HMDS data farm warnings, and keepalive ping timeouts. Non-actionable alert volume reduced ~90%.
v5.7.5 — FIX
TP Push Cleanup + Bracket Tracking
Simplified SL-only 1R lock from 3 redundant calls to 1. Bracket order ID tracked after entry (was always None). Foundation for reliable bracket lifecycle management.
v5.7.0 — DYNAMIC UNIVERSE
IBKR Dynamic Universe Scanner
Daily scan of 113 futures symbols via ibkr_universe_updater.py. 8-step pipeline: resolve contracts, filter trending (ADX/ATR/volume), micro preference dedup, composite ranking. Core MES+MNQ guaranteed. 12 dynamic products selected. Systemd timer at 22:30 UTC.
v5.6.2 — AUDIT
Audit Fixes — Secrets + Constants
Telegram credentials moved to environment variables. TF_SECONDS consolidated into shared constants module. Pinned requirements.txt added. CoPilot audit: 45 findings reviewed, 42 already handled or architectural — 3 actioned.
v5.6.1 — CONFIG-DRIVEN
Hardcoded Literals Cleanup
Dashboard port/host, cache TTL, and state file path extracted to config. Dead code cleanup: 3 unused variables removed. All new config keys default to current values — zero functional change.
v5.5.9 — CONFIG-DRIVEN
Code Cleanup Sprint
Dead code removal, mojibake fix (30 instances), config cleanup, ASCII-only docs, dup import removal, path parameterization.
v5.5.7 — SAFETY
4-Fix Graduation Safety Patch
Deep codebase audit (13,747 lines, 13 files) found critical bug: WebSocket partial exit was passing sl_px=0 to graduation, placing standalone stops at $0 for ~2 seconds. Also fixed exit detection for graduated positions, isolated graduation exception handling, and cleared stale bracket IDs across all call paths.
v5.5.5 — FEATURE
Bracket Graduation — No Profit Ceiling
After partial exit at 1.5R, the exchange bracket is destroyed and replaced with a standalone trailing stop. Remaining position rides the trend with no TP cap — trades can now capture 3R, 5R, 10R+ moves instead of being capped at 2.0R. The standalone stop syncs to the software trailing level every tick via WebSocket.
v5.5.0 — FEATURE
WebSocket Trade Management
Price-sensitive trade management (1R profit lock, partial exit, trailing stop) now runs via Coinbase WebSocket ticker feed in sub-second time. REST polling continues as a 60-second fallback for time exits and bracket detection. Shadow mode allows risk-free testing before live activation. Rollback via a single config flag.
v5.4.77 — FEATURE
Trailing Take Profit — No Profit Ceiling
After partial exit, the exchange bracket TP is pushed far away via the Coinbase Edit Order API, removing the 2.0R profit ceiling. The bracket SL is synced to the trailing stop level every cycle, so if the bot crashes mid-trail, the exchange catches the exit at the last known level. New TRAIL exit classification with peak-R tracking.
v5.4.34 — HARDENING
Atomic State & Concurrent Safety
All state writers now use atomic saves (write-to-tmp then rename) with .bak backup and fallback load. fcntl advisory locking prevents race conditions between the 3 services that write to shared state.
v5.4.31 — CRITICAL
TM Decoupled from Equity
An equity API failure (returning 0) caused the bot to skip the entire cycle, including all trade management. Trailing stops, breakeven, and software SL were all skipped while positions sat unprotected.
v5.4.29 — CRITICAL
Phantom Exit Protection
One bad API response returning zero positions would cause the bot to mark every tracked position as exited, orphaning them on-exchange with no software trade management. Now skips the entire cycle with counter-based recovery.
v5.4.16 — OPS
Software SL Hardened
If trailing/breakeven close failed all retries, positions were exposed with only the original wider bracket. Added 5-attempt exponential backoff with critical Telegram escalation on total failure.
v5.4.12 — CRITICAL
Volume Calculation Inversion
All volume checks were using raw base units instead of USD notional. This inverted the filter—blocking liquid majors while passing illiquid meme coins. Fixed across 4 independent code paths.
Infrastructure

Cloud-Native, Always-On

Designed for unattended operation. The system monitors itself, restarts crashed services, and alerts on anomalies.

Compute & Operations

Platform Google Cloud Platform
Process Manager systemd (14 units)
Auto-Restart Enabled
Log Rotation Daily, 7-day retention
Backups GCS daily @ 03:00 UTC
Version Control GitHub (git pull deploy)

Configuration

Config Source config_live.yml (single truth)
Startup Validation Fatal on invalid
Credentials Externalized (.gitignored)
Alerting Telegram (real-time)
Dashboard WebSocket PWA (:8080)
Exchanges Coinbase INTX + IBKR Gateway + IG Markets
# Verify all services with one command
$ for s in cb-perp-bot ibkr-bot ig-bot pairs-bot trade-alerts bot-monitor dashboard log-watcher; do
    printf '%-20s %s\n' $s $(systemctl is-active $s)
  done

cb-perp-bot          active
ibkr-bot             active
ig-bot               active
pairs-bot            active
trade-alerts         active
bot-monitor          active
dashboard            active
log-watcher          active

# Timer-based services
universe-updater     active   # every hour
ibkr-univ-updater    active   # daily 22:30 UTC
daily-summary        active   # midnight UTC
performance-tracker  active   # periodic stats
Signal Service

Multi-Engine Signals,
One Subscription

Receive trade signals across crypto perpetuals, CME micro futures, and forex. Every signal is generated by the same sweep-validated strategies running in production. Information only — no fund management, no API key access.

Free
$0
Learn the system. See the results.
  • Strategy education & explainers
  • Community chat
  • #showcase equity curve
  • Weekly market commentary
  • 🔒 No trade signals
  • 🔒 No dashboard access
Join Free
Signal
$25/mo
All signals, 1-hour delayed across all 3 engines.
  • Everything in Free
  • Crypto signals (1hr delay)
  • Futures signals (1hr delay)
  • Forex signals (1hr delay)
  • Signal results & tracking
  • 🔒 No real-time feed
Get Started
Pro
$75/mo
Everything + weekly AMA + 24h founder SLA.
  • Everything in Trader
  • Weekly AMA with founder
  • 24-hour response SLA
  • Feature voting & status tracking
  • Pro-only lounge
  • Direct line to founder
Go Pro

Information-only service. GateSig provides trade signals and market analysis. We do not manage funds, access your exchange accounts, or provide API keys. All trading decisions are yours. Past performance does not guarantee future results. Crypto payments accepted.