CoinFlipBot
Inspired by Tom Basso’s coin-flip experiment (with Van K. Tharp, 1990s): the edge can come from risk management, exits, and sizing—not clever entries. Instead of hunting for a perfect signal, the question is: what happens if entries are random but exits and position sizing are disciplined? In tests across diversified futures, combining ~1% risk per trade, a volatility-based trailing stop (e.g., 3× ATR), and consistent rules produced positive expectancy even when entry was decided by chance.
Equally important is diversification across low-correlated markets (currencies, rates, energies, metals, grains, livestock). Uncorrelated streams help:
- Dampen portfolio volatility
- Stabilize compounding (avoid big equity cliffs)
- Improve risk-adjusted performance
In short: profitability came not from prediction but from position sizing, volatility-aware exits, and cross-market diversification. This bot mirrors that setup: ~1% risk per trade, a 3× ATR trailing stop, and a diversified futures basket, so you can see the principles play out in your own results.
Overview
- What it demonstrates: Order flow, SL/TP, intrabar behavior, commissions/slippage/margins, and per-asset stats (win rate, expectancy, drawdown).
- Risk first: Fixed-fractional sizing (~1% of equity per trade) and 3× ATR trailing stops (ATR smoothed via a 10-day EMA).
- Environment-agnostic: Same bot runs in backtests and against live data.
- Diversified universe: A subset of Basso’s futures basket to keep portfolio variance in check.
- What you’ll see: Many small losses and a handful of outsized winners—the classic trend-following profile—compounding over time when sizing and exits are consistent.
How the experiment was conducted
- Universe: ~10 liquid futures spanning commodities, currencies, rates, energy (this page uses 8 of them).
- Entry: entirely random (coin flip: long/short) per market.
- Always in: when a position closed, the system stood ready to re-enter on the next bar with the same random logic.
- Evaluation: track results across all markets to observe combined equity and win/loss distribution.
The rules we reproduce here
- Risk per trade: ~1% of equity (fixed-fractional).
- Volatility measure: 10-day EMA of ATR (smoothed ATR).
- Initial stop: 3 × volatility from entry.
- Trailing exit: the same 3× ATR stop ratchets only in your favor (never loosens).
- Diversification: apply the identical rules across multiple, low-correlated futures.
Markets used in Basso’s test (10 futures)
- Gold
- Silver
- U.S. Bonds (long-term Treasury bond futures)
- Eurodollars (short-term interest rate futures)
- Crude Oil
- Soybeans
- Sugar
- Deutsche Mark (pre-euro currency future)
- British Pound
- Live Cattle
Notes: The Deutsche Mark was later replaced by the euro; Eurodollars have largely been superseded by SOFR futures in modern markets.
Mapping used on this site (8 of the original 10)
Basso market | Symbol (example) | Comment |
---|---|---|
Gold | GC=F | COMEX Gold |
Silver | SI=F | COMEX Silver |
U.S. Bonds | ZB=F | 30-Year Treasury Bond |
Eurodollars | — | Not included here (SOFR analog) |
Crude Oil | CL=F | NYMEX WTI |
Soybeans | ZS=F | CBOT Soybeans |
Sugar | — | Not included here |
Deutsche Mark | 6E=F | Euro FX (successor to DEM) |
British Pound | 6B=F | British Pound FX |
Live Cattle | LE=F | CME Live Cattle |
Open the notebook
View Notebook →