DISCLAIMER: This project is for educational and technological demonstration purposes only. It is NOT financial advice and should NOT be used in production trading without fully understanding the risks, independently verifying the logic, and accepting the possibility of significant financial loss. Backtested results do not guarantee future performance. The authors assume no responsibility for any losses incurred. Past performance in simulated environments has no bearing on real-world outcomes. Use at your own risk.
A dual-regime trading strategy that exploits the time delay between BTC price movements and altcoin reactions. When BTC drops sharply, altcoins follow with a lag of seconds to minutes - this bot captures that window.
This strategy is idle ~98% of the time. It only trades when BTC makes a sharp move - which happens a few times per day at most, with each position lasting 15–30 minutes. The rest of the time, your capital sits in USDT doing nothing.
This makes it ideal as one component in a broader portfolio:
- Chain it with other strategies that use capital during the idle periods
- Hold a portion of your portfolio in BTC (e.g., 30%) to capture long-term appreciation while the rest waits for signals
- Build your own basket - combine this with trend-following, market-making, or yield strategies to maximize capital efficiency
Think of it as a specialized tool, not a total solution. It does one thing - capture lead-lag mispricings. How you deploy the idle capital is up to you.
The bot classifies the market into regimes using BTC's 7-day return and trades accordingly:
- Action: Short altcoins when BTC drops >1% in 5 minutes
- Hold time: 15 minutes
- Leverage: 1–2x (scaled with drop magnitude)
- Rationale: In downtrends, altcoins amplify BTC's losses with a delay
- Action: Long altcoins when BTC dips >0.5% in 5 minutes
- Hold time: 30 minutes
- Leverage: 1x (no leverage)
- Rationale: In uptrends, BTC dips are buying opportunities - altcoins recover and overshoot
- Regime filter: No trading in "neutral" zone (BTC 7d between -5% and 0%)
- 3-day momentum: Bull dip-buys skipped if BTC 3d return < 0% (avoids falling knives)
- Max drop cap: Bear shorts skipped if BTC drops >2% (crash bounce-back risk)
- Time-of-day: Skips UTC hours 7–11 (low-liquidity window)
- Leverage cap: Maximum 2x to limit downside
19 altcoins across market cap tiers, all confirmed on Kraken Futures:
| Large Cap | Mid Cap | Small Cap |
|---|---|---|
| ETH, SOL, BNB, XRP | ADA, AVAX, LINK, DOT, NEAR, SUI | ARB, OP, APT, INJ, FET, PEPE, TIA, DOGE, SHIB |
| Metric | Value |
|---|---|
| Period | Apr 2022 – Mar 2026 (1,440 days) |
| Starting Capital | $10,000 |
| Final Capital | $47,839 |
| Total Return | +378% |
| Annualized Return | ~49% |
| Max Drawdown | 47.1% (2022 crypto crash) |
| Win Rate | 55% |
| Total Trades | 25,230 |
| Rolling 6-Month Windows | 13/14 profitable |
| BTC Buy & Hold (same period) | +76% |
Why to be cautious: The 55% win rate is real but thin - it doesn't take much alpha decay to push it below 50%. As crypto markets mature (more institutional participation, better cross-exchange arbitrage), the lag shrinks. The 2025–2026 data in the backtest shows fewer bear events and smaller per-trade returns compared to 2022–2023, which could be early signs of the edge compressing. Anyone with faster infrastructure running the same logic would front-run you, taking the profit before your order fills.
Crash resilience: The backtest period includes the May–June 2022 crypto market crash (Luna/UST collapse, Three Arrows Capital, Celsius), where BTC fell from ~$40K to ~$17K. The strategy suffered a -47% drawdown during this period but recovered fully and went on to produce strong returns. While this demonstrates survivability through a historic meltdown, it does not guarantee survival through future ones.
Note: Backtest results represent a ceiling, not a guarantee. Expect significant degradation in live trading due to execution slippage, order fill uncertainty, exchange downtime, and alpha decay.
trade/
├── config.yaml # Coins, timeframes, DB path, history length
├── requirements.txt # Python dependencies
├── data/
│ ├── trade.duckdb # 4 years of 1m OHLCV data (Binance)
│ └── simulation/ # Backtest charts
├── scripts/
│ ├── collect_data.py # Fetch/update historical price data
│ ├── simulate_6months.py # Run backtests with full reporting
│ └── paper_trade.py # Live paper trading via Kraken Futures
└── src/
├── data/
│ ├── fetcher.py # Binance OHLCV fetcher with retry logic
│ ├── storage.py # DuckDB read/write layer
│ └── collector.py # Orchestrates fetching + storage
├── features/
│ └── engineering_v2.py # Feature builder (returns, spreads, targets)
└── paper/
├── config.py # All strategy parameters as dataclasses
├── trader.py # Paper trading engine (WebSocket-driven)
├── price_tracker.py # BTC price monitor + regime stats
└── position_manager.py # Tracks open positions and P&L
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtAdditional dependency for paper trading (WebSocket support):
pip install ccxt[pro] matplotlibFetches 1-minute candles from Binance for all configured coins. Supports incremental updates - only fetches missing data.
python scripts/collect_data.pySimulates the full strategy with compounding capital, regime filters, and realistic fees (0.02% maker + 1 bps slippage per side). Loads data in monthly chunks to keep memory usage low.
python scripts/simulate_6months.pyOutputs: full performance report, monthly breakdown, rolling 6-month window analysis, equity curve and drawdown charts.
Connects to Kraken Futures public WebSocket feeds (no API key required) and simulates trades in real time.
python scripts/paper_trade.pyKey options:
python scripts/paper_trade.py --capital 5000 # custom starting capital
python scripts/paper_trade.py --no-bull # bear-only mode
python scripts/paper_trade.py --max-leverage 1.5 # lower leverage cap
python scripts/paper_trade.py --max-bear-drop 1.5 # tighter crash filter
python scripts/paper_trade.py --bull-3d-min 2.0 # stricter bull momentum
python scripts/paper_trade.py --no-regime-filter # disable regime checksPress Ctrl+C to stop gracefully. Trades are logged to data/paper/.
- BTC Price Tracker monitors BTC/USD via WebSocket, computing rolling 5-minute returns
- When BTC drops beyond the threshold, a signal fires
- The regime classifier checks BTC's 7-day and 3-day returns to determine bear/bull/neutral
- If the regime permits, the bot opens positions across all 19 altcoins simultaneously
- Positions are held for the configured duration (15m bear / 30m bull), then closed
- Capital compounds - each trade uses the full current portfolio value
All strategy parameters live in src/paper/config.py as Python dataclasses with sensible defaults. Key parameters:
| Parameter | Default | Description |
|---|---|---|
btc_threshold_pct |
1.0% | Min BTC drop to trigger bear short |
max_bear_drop_pct |
2.0% | Max BTC drop (skip if exceeded) |
hold_minutes |
15 | Bear short hold time |
max_leverage |
2.0 | Leverage cap for bear shorts |
dip_threshold_pct |
0.5% | Min BTC dip for bull dip-buy |
bull_hold_minutes |
30 | Bull dip-buy hold time |
min_btc_3d_return |
0.0% | 3-day momentum filter for bull entries |
bear_threshold |
-5.0% | BTC 7d return below which = bear regime |
bull_threshold |
0.0% | BTC 7d return above which = bull regime |
