Automated Trading System

Institutional-Grade
Crypto Perpetuals
Trading Engine

A fully autonomous trading system executing Donchian breakout strategies with multi-timeframe confirmation on Coinbase International Exchange perpetual futures. Built for resilience. Hardened in production.

7
Safety Layers
5-condition
Entry Gate
24/7
Autonomous
40+
Edge Cases Handled
EXPLORE
Trading Strategy

ADX Breakout with
Multi-Timeframe Confirmation

Every trade must pass five independent conditions before entry. No single indicator drives decisions—convergence of signals filters noise from conviction.

Five-Gate Entry System

  1. 1

    Donchian Breakout

    Price exceeds 12-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

Intelligent Exit Management

🛑

Stop Loss

Hard bracket order on exchange

2.5× ATR
🎯

Take Profit

Full exit target

5.0× ATR
✂️

Partial Profit

50% position closed early

1.5R
🛡️

Breakeven Stop

SL moved to entry price

@ 1.0R
📈

Trailing Stop

Follows price at 1.5 ATR

@ 2.0R

Time Exit

Force close stale positions

72 hrs
POSITION SIZING
15% equity per position · 3 max slots + 1 reserved
Per-trade risk capped at 2% of account equity
7
Services Running
25mo
Backtest Validation
42+
Bug Fixes Deployed
0
Manual Intervention
System Architecture

Seven 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 cycle.
🔍
UNIVERSE UPDATER
Discovers trending assets via ADX/ATR/volume scanning + mini-backtest validation.
📊
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, trades.
📨
DAILY SUMMARY
Automated daily P&L report via Telegram at midnight UTC.
☁️
GCS BACKUP
Daily automated backup of state, config, and trade history to cloud storage.
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

Breakeven stops, trailing stops, partial profit-taking, and time-based exits run every 60 seconds. 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 $5M, 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 40+ 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, positions, scanner, and trade history. PWA-enabled for mobile home screen installation. 10-second refresh cycle.

🔎

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. Parameter sweep capability for systematic 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.

🔒

Reserved OMG Slot

When ADX exceeds 40 and signal score is ≥ 3.0, a fourth position slot opens for high-conviction setups. Opportunity capture without sacrificing risk discipline.

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.

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.
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.28 — CRITICAL
Paused Products Overwrite Bug
The bot loaded state once at startup and saved its in-memory copy every 60 seconds, silently overwriting performance tracker's pause decisions. Pausing was completely non-functional during runtime.
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.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.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.
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 (7 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)
Exchange Coinbase INTX API
# Verify all services with one command
$ for s in cb-perp-bot trade-alerts bot-monitor dashboard; do
    printf '%-20s %s\n' $s $(systemctl is-active $s)
  done

cb-perp-bot          active
trade-alerts         active
bot-monitor          active
dashboard            active

# Timer-based services
universe-updater     active   # every 2 hours
daily-summary        active   # midnight UTC
performance-tracker  active   # periodic stats