Markets
SPY5,248.32+0.35%
QQQ18,432.10+0.52%
BTC98,420+1.27%
ETH3,812-1.10%
NVDA952.30+1.36%
AAPL178.42-1.19%
TSLA168.90+2.62%
EUR/USD1.0892-0.21%
GC2,342.50+0.36%
CL82.15+1.17%
SOL178.50+3.36%
DXY104.82+0.14%
SPY5,248.32+0.35%
QQQ18,432.10+0.52%
BTC98,420+1.27%
ETH3,812-1.10%
NVDA952.30+1.36%
AAPL178.42-1.19%
TSLA168.90+2.62%
EUR/USD1.0892-0.21%
GC2,342.50+0.36%
CL82.15+1.17%
SOL178.50+3.36%
DXY104.82+0.14%
389
tf/algorithmsPosted by u/algo_trader_42

My crypto mean reversion bot does 2.1% per month — code and logic shared

Built a mean reversion bot on ETH/BTC and SOL/BTC pairs. Running for 8 months on Binance.

Logic

The ratio between two cryptos tends to revert to its mean. When the 20-day z-score exceeds +2 or -2, I take the opposite position.

Results (8 months, $20K)

  • Total return: +18.4% ($3,680)
  • Sharpe: 1.2
  • Max drawdown: -6.8%
  • Win rate: 63%
  • Number of trades: 142

Stack: Python, ccxt, PostgreSQL, Grafana for monitoring. Code is on my GitHub (link in comments).

6 Comments

Connectez-vous pour laisser un commentaire

Sort by:
macro_man·edited

Sharpe of 1.2 is decent but careful: mean reversion works in ranges but on a real directional trend you get destroyed. How do you handle breakouts?

67
algo_trader_42OP·edited

I have a trend filter. If the z-score stays above 3 for more than 5 days, I cut the position and wait. It saved me in January when SOL/BTC went +40% in 2 weeks.

45
crypto_dave·edited

Are you accounting for funding rate fees on Binance futures? Because holding shorts on SOL during hype periods costs 0.1%/day sometimes.

56
algo_trader_42OP·edited

Good point. I trade spot only, no futures. So no funding rate. But it means I can only short the ratio by selling one and buying the other.

33
chart_wizard·edited

How far back did you backtest? 8 months live is good but does it hold up on 2-3 years of historical data?

43
macro_man·edited

Have you considered using a cointegration model (like Engle-Granger) instead of a simple z-score? It should better capture non-stationary relationships.

38