You are browsing as a guest. Sign up (or log in) to start making projects!

AI APEX Trader

  • 1 Devlogs
  • 0 Total hours

A systematic crypto trend-following bot that trades BTC-EUR and ETH-EUR. It enters on a30-day Donchian breakout confirmed by Supertrend(10,3) and a200-day SMA filter (daily candles), exits when Supertrend flips, and protects every position with a6×ATR Chandelier hard stop,25%-of-equity sizing, a50% max total exposure cap, and a −5% daily equity circuit breaker. An LLM fallback chain (Groq → OpenRouter) acts as a risk-off veto on entries only — it can block a trade but can never create one. The bot runs fully unattended in the cloud: a cron-job.org pinger fires a GitHub repository_dispatch every15 minutes, GitHub Actions executes a trading cycle, and state is committed back to the repo, with ntfy.sh phone push alerts on entries/exits. Currently paper trading €500. The strategy was validated with walk-forward out-of-sample backtesting (fee + slippage modeled; all7 neighboring parameter combos OOS-positive) before deployment.

Ship #1 Pending review

What I made

apex-trader — a fully autonomous crypto trend-following bot trading BTC-EUR and ETH-EUR on Revolut X. It enters only when three conditions align on daily candles: price breaks above a 30-day Donchian channel, Supertrend(10,3) points up, and price sits above the 200-day SMA. It exits when Supertrend flips, protected by a Chandelier hard stop (6xATR). Risk is rules-based: max 25% of equity per position, max 2 positions, 50% exposure cap, -5% daily circuit breaker. An LLM (4-model fallback chain: Groq -> OpenRouter) reviews each entry as a risk-off veto — it can block trades but never create them, and fails open if all models are down. It runs unattended in the cloud: a cron-job.org pinger triggers a GitHub Actions cycle every 15 minutes, the bot commits its own state and decision log back to the repo, and ntfy.sh pushes entry/exit alerts to my phone. Currently paper trading EUR 500.

What was challenging

The hardest part wasn’t the strategy — it was trusting it, then deploying it. My first backtests looked amazing until I learned to distrust them: I built proper out-of-sample validation (frozen parameters, last 30% of history, real fees + slippage) plus a robustness check across all 7 neighboring parameter combos. That process killed one exit rule — the Donchian lower band was silently cutting winners on ~100% of bars; removing it improved OOS Sharpe on both assets. On deployment, GitHub’s built-in 15-min cron proved unreliable (measured gaps of 76-204 minutes overnight), so I built an external metronome via cron-job.org + repository_dispatch — then debugged a misleading 404 that turned out to be GitHub’s response when a fine-grained PAT can’t see a repo (fixed with least-privilege token scoping). I also had to guarantee the local and cloud bots could never run simultaneously — shared git state means double-trade risk.

What I’m proud of

The discipline. Every number in my README carries its caveats: out-of-sample trade counts are below statistical significance and I say so; buy-and-hold actually beat the strategy on raw return in the bull window, and I publish that too — the real edge is drawdown survival (-11% vs -52% for holding). The bot runs itself for days with zero intervention, every decision logged to a public JSONL audit trail from cron ping to trade decision. The LLM is caged — used only where it’s defensible (a second opinion on risk) and locked out of creating trades. And the parity check: live bot logic vs backtest engine, 0 mismatches — the bot IS what was tested.

How to test it out

No UI — it’s headless — but everything is verifiable:

  1. Watch it live: the repo’s Actions tab shows a full trading cycle every 15 min (market data -> signals -> decision).
  2. Read its mind: apex_decisions.jsonl logs every decision it has ever made with reasoning; apex_state.json is its current portfolio.
  3. Reproduce my backtest: clone the repo, pip install -r requirements.txt, python backtest_apex.py — public Coinbase data, zero secrets needed; you should get the same numbers as the README table.
  4. Run it yourself: python apex_trader.py defaults to paper mode with zero secrets — it evaluates live market data and tells you what it WOULD do. It can’t place a real order unless you deliberately set LIVE_TRADING=true and add exchange credentials.
  • 1 devlog
  • 0h
Try project → See source code →

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…