Part 1 recap (full Part 1 here): yesterday I launched a ZECUSDT futures grid with 200 grids across the 800–2000 USDT range. A $100 short lost, but the Martingale futures grid made $100+, ZEC spot made $20, and total assets peaked at $1,080. After withdrawing $200, I have $880 left compounding. The goal: turn 800 into 1000 every day and withdraw 200.
Part 2’s theme: I’m not going to rely on luck. This post is the deep research I did for myself — the mathematical truth about grids and Martingale, how to build my envisioned “15-minute range strategy” scientifically, how to pick the tech stack, where to find real alpha, and finally the LynxCrypto system development prompt I’ll hand over to an AI.
0. Three Buckets of Cold Water First (Expectation Management)
Before any technique, here are the three hardest sets of numbers from the research. They set the tone for every decision that follows:
The retail baseline is losing. In a study of the Brazilian equity index futures market, 97% of retail traders who persisted beyond 300 days lost money, and only 1.1% earned more than the local minimum wage ($16/day). Chague et al. 2019, via Day trading - Wikipedia
A pretty backtest ≠ future performance. A 2026 pre-registered experiment (MinervaScore) found that a composite score integrating five robustness checks — including the Deflated Sharpe Ratio and probability of backtest overfitting — had almost zero predictive power for future returns (Spearman ρ=0.013, p=0.40). Equity Strategy Backtesting: MinervaScore (arXiv:2608.23808)
Strategies decay the moment they’re published. The single variable “year of publication” explains 30% of the variance in factor Sharpe decay — any public strategy you can find online is most likely already on its way to stopping working. Why and how systematic strategies decay (arXiv:2105.01380)
Taken together, these three mean: turning 800 into 1000 daily (25% per day) is not a “goal” — it’s a behavioral trap that forces you to add size on losing days to gamble it back. A sane objective function is “survive long + slightly positive expectancy”; profit is a byproduct of survival. Every system design below obeys this premise.
1. My 200-Grid Bot: Getting the Math Straight First
1.1 The Grid’s Essential Structure
My parameters: 800–2000 USDT, 200 grids, arithmetic spacing, 6 USDT per step. One easily missed detail: with an arithmetic grid, the percentage step at the bottom of the range (0.75%) is 2.5× that at the top (0.30%); switch to a geometric grid and each step is about 0.459%, which is naturally “heavier buys at the bottom” and better suited to high-volatility instruments. Arithmetic and Geometric grid types — Gainium
Real per-grid profit has to clear the fee hurdle. Bybit’s official formula: profit per grid = interval spacing × quantity per grid × completed grids − fees, and its futures taker fee is 0.055% (VIP0), roughly 0.11% round-trip — if gross per-grid margin is below 0.11%, you’re working for the exchange, and Bybit itself caps the maximum grid count to ensure “grid profit > fees.” P&L Calculations (Futures Grid Bot) — Bybit Bybit Trading Fee Structure
There’s also a slow bleed: perpetual swaps settle funding every 8 hours (00:00/08:00/16:00 UTC). A 50,000 U notional grid position at a mild +0.01%/8h rate gets drained of about 450 U per month; in extreme conditions at +0.10%/8h, that’s 45% of principal per month. Pionex Futures Grid explainer What Are Funding Rates — Cube Exchange
1.2 The Liquidation Math of Martingale Sizing (I Computed It Myself)
The most valuable part of the research: I modeled the liquidation price of “200 grids + Martingale sizing” myself. Model (note: my inference, not from any source): margin at grid i is M₀·m^i (m = sizing multiplier), leverage L, average cost after filling the whole grid P̄; the cross-margin liquidation price is approximately:
| |
Q is total coin holdings, mmr is taken as 0.5% (in reality it rises with position tiers, so this estimate is optimistic — actual liquidation is even closer).
Scenario: price bleeds down from 2000 and fills the entire long grid. Results:
| Scheme | Leverage | Avg Cost | Liq. Price | Implication |
|---|---|---|---|---|
| No sizing-up (m=1) | 2x | 1,306 | ~656 | Survives an 18% further drop below 800 |
| No sizing-up (m=1) | 5x | 1,306 | ~1,050 | Liquidated inside the grid |
| No sizing-up (m=1) | 10x | 1,306 | ~1,182 | Liquidated inside the grid |
| m=1.1 | 2x | 1,932 | ~971 | Liquidated inside the grid |
| m=1.1 | 5x | 1,932 | ~1,553 | A 22.3% drop from 2000 wipes everything |
| m=1.2 | 5x | 1,963 | ~1,579 | A 21% drop wipes everything |
| m=2.0 | 5x | 1,988 | ~1,598 | A 20% drop wipes everything |
The structural conclusion (follows directly from the math): as long as the sizing multiplier m>1, geometric series summation forces nearly all margin onto the final grids near 2000 (with m=1.1 and a $10k budget, the first grid’s margin is about 0.00005 U vs ~909 U on the last — a 170-million-fold difference), pushing average cost above 1900. So even at 2x leverage, the liquidation price falls inside the grid range itself. Martingale didn’t widen your survival zone — it just traded the nominal comfort of “covering a 60% drawdown” for the actual exposure of “total wipeout on a 22% drop.”
This explains why my Martingale grid “made $100+” yesterday: its high win rate is by design. The optional stopping theorem long ago proved rigorously that with finite capital (always true in reality), Martingale must lose in the long run; its return distribution is “frequent small wins + rare total wipeouts.” The probability of hitting a 6-loss streak within 200 rounds is about 84%; a 10-loss streak (a loss 1023× the initial bet) has about an 11% probability within 200 rounds. Martingale (betting system) — Wikipedia In institutional language, a Martingale grid “doesn’t safely recover losses — it postpones and amplifies them until either a reversal arrives or the account dies first” — many prop firms explicitly ban this class of strategy. Grid Trading: How It Works and Where It Breaks — Audacity Capital
My upgrade list for my own grid (from research + computation):
- Fix the sizing multiplier at m=1 (equal size per grid); drawdown becomes linear and computable;
- Add a hard circuit breaker: if the whole grid’s floating loss hits X% of margin, flatten everything — Audacity Capital calls this “the single most important control”;
- Replace the fixed 6 U step with ATR-based dynamic spacing:
spacing = clamp(ATR% × 0.6, 1%, 4%). In testing, moving an ETH grid from a fixed 1.5% spacing to 1.0% (≈0.6×ATR) roughly doubled fill frequency; Dynamic grid spacing with ATR — dev.to - Trend filter: use ADX to classify the regime, and stop running range grids in trending markets (expanded in the next section).
2. My “15-Minute Range Strategy”: From Intuition to Executable Design
My original idea: use the range of 15-min candles to find a band covering the vast majority of fluctuations, compute entry positions from the risk/profit balance point, trade both directions, flip short the moment a long ends, and use certain indicators to avoid getting crushed by one-way moves. After the research, this idea decomposed into five concrete, literature-backed decisions.
2.1 How to Define the Range: Not Fixed Points — Volatility-Adaptive
The industry has three standard off-the-shelf approaches for “using historical volatility to set a channel”:
- Keltner Channel: EMA20 ± 2.0×ATR(10). Uses ATR (smoother than standard deviation) and EMA (more responsive than SMA) — the best ready-made structure for a “volatility-adaptive range.” Keltner Channels — StockCharts ChartSchool
- Bollinger Bands: SMA20 ± 2σ. Note the empirical detail: price series are fat-tailed and serially correlated, so in practice only about 88% of prices (not the 95% assumed by normality) fall inside the bands. Bollinger Bands — Wikipedia
- Donchian Channel: the N=20 highest/lowest prices (the Turtles used a 20/55 dual period). Donchian channel — Wikipedia
Academically, the closest match to my idea is the Opening Range Breakout (ORB): Holmberg et al. set breakout thresholds from the return distribution, enter only when price crosses the threshold, and measured significantly positive returns on crude oil futures. Assessing the profitability of intraday opening range breakout strategies — Umeå University
Design decision: entry threshold = prev_close ± k × ATR(15min) or ±k × rolling-range quantile, with k calibrated by parameter sweep rather than guesswork.
2.2 Breakout-Following or Mean Reversion? — Let the Regime Choose for You
This was the most counterintuitive finding of the research: the industry’s default breakout-following rules are not stable in academic tests, while the contrarian (mean-reversion) usage has recorded positive returns. Lento et al. (2007) found standard Bollinger strategies failed to beat buy-and-hold; but Balsara et al. (2007) found contrarian channel-breakout rules still earned significantly positive returns after 0.5% costs. Bollinger Bands — Wikipedia (Caveat: the evidence comes from daily equities/FX and can’t be directly extrapolated to crypto 15-min, but the direction deserves respect.)
Another warning: Donchian default parameters won only 35% of trades in a backtest spanning 360 years of cross-market data and 4,887 trades, and “may be unprofitable once slippage is included.” Donchian channel — Wikipedia
Design decision: no single mode. Use a regime filter to pick one of two —
- ADX < 20 (no trend): run mean reversion; open contrarian positions at the channel’s upper/lower rails. The ADX 20/25 thresholds are Wilder’s original settings. ADX — StockCharts ChartSchool
- ADX > 25 (strong trend): breakout-following only, and never reverse to the opposite side — this is exactly the “anti-one-way-crush” protection I wanted.
- 20–25 gray zone: reduce size or sit out.
- Higher-timeframe confluence: take 15-min signals only when the 1H/4H EMA direction agrees (standard top-down multi-timeframe practice). How To Perform A Multi TimeFrame Analysis — Tradeciety
2.3 “Flip Short the Moment a Long Ends” Is a Trap
My originally envisioned stop-and-reverse (always in the market, instant long/short switching) has a well-known structural problem: in choppy markets, whipsaws double the bleed — “death by a thousand stops.” And every flip = closing fee + opening fee + two slippages; at crypto taker fees of ~0.055% per side, a few flips on a choppy day can eat the entire expected edge. How To Manage Whipsaws — Optimus Futures Whipsaw in Trading — 5paisa
Design decision: allow “flat” as a position state. Close → observe → re-enter only after the new direction’s signal is confirmed by ADX/higher timeframes. Flat is a legitimate position.
2.4 Exits: Time Stops Are Worthier of Testing Than Price Stops
QuantifiedStrategies’ backtests show: the time stop is “the simplest and most underrated exit” — it cuts drawdowns, reduces time-in-market, and resists overfitting; fixed stops and trailing stops mostly hurt strategy performance in their tests. When to Exit a Trade — QuantifiedStrategies
Design decision: if the target isn’t hit within N 15-min bars after the breakout, force the exit; price stops serve only as disaster insurance (placed 1×ATR beyond the channel), not as routine exits.
2.5 Three Perpetual-Swap Specifics
- Funding-timing games: funding is paid/received only by positions held at the 00/08/16 UTC settlement timestamps. +0.05%/8h is roughly a 54.75% annualized cost for the paying side. Most 15-min strategy positions don’t span a settlement, but log “signal direction vs funding sign” to avoid holding longs through settlement when funding is strongly positive. Cube Exchange Bimal Institute
- Mark-price liquidation: liquidation is triggered by the mark price (which includes the funding basis), not the last price; funding payments continuously erode margin and pull the liquidation price toward the current price. A backtest that doesn’t simulate mark-price rules simultaneously underestimates “wick-out liquidations” and overestimates “mark-price protection.” Cube Exchange
- Extreme funding as a contrarian signal: in 2024, aggregate BTC funding was negative on only 26 days of the year — persistently positive funding ≠ imminent reversal, but extreme readings above 0.1%/8h have historically tended to precede 10–30% pullbacks (the latter is the source’s opinion; stance noted). Cube Exchange Bimal Institute
3. Tech Stack Selection (2025–2026, Empirically Verified)
The research used the GitHub API to check each framework’s maintenance status (2026-09-04). The conclusions are clear.
3.1 Language: Python, No Contest
Freqtrade, Hummingbot, Jesse, OctoBot, vectorbt, and vn.py are all Python; the pandas/NumPy ecosystem is directly usable. TypeScript is CCXT’s source language and gets updates fastest, but its quant backtesting ecosystem is far weaker than Python’s; Rust (NautilusTrader’s core) belongs to latency-sensitive scenarios that an $880 bankroll doesn’t need. CCXT GitHub NautilusTrader GitHub
CCXT is the de facto industry standard: transpiled from TypeScript into 7 languages, covering 104 exchanges, unifying REST + WebSocket APIs, with a built-in rate limiter and unified exception hierarchy. Self-built execution layer = Python + ccxt (asyncio). CCXT GitHub
3.2 Frameworks: A Phased Combination, Not a Single Choice
| Phase | Tool | Rationale |
|---|---|---|
| Research/backtesting | vectorbt | Vectorized backtesting; the official demo runs 10,000 parameter sets in seconds; built-in walk-forward and range_split for multiple out-of-sample comparisons — ideal for “parameter plateau” analysis (pick flat regions, not spikes). vectorbt |
| Live trend/signal strategies | Freqtrade (54k stars, highly active) | Backtesting + hyperopt (Optuna) + dry-run paper trading + Telegram control in one package; ships with lookahead-analysis to automatically catch lookahead bias. Freqtrade |
| Live two-way futures grids | Hummingbot V2 | The key hard constraint: Freqtrade enforces One-way position mode on Binance futures (stated explicitly in the official docs); only Hummingbot’s Binance perpetual connector supports both Hedge mode and testnet. Freqtrade Exchange Notes Hummingbot Binance connector |
| Avoid | Backtrader | Last commit 2024-08-19 — effectively unmaintained for over 2 years. |
3.3 Exchanges and Account Security
- First-hand fee data: Bybit futures VIP0 taker 0.055% / maker 0.020% (the only official source obtained this time; Binance/OKX fee pages were blocked by anti-scraping — in practice, defer to the account’s actual fee rate). Bybit Trading Fee Structure
- OKX officially confirms it has spot/futures grid bots (Futures Grid). OKX Trading Bots
- Minimum-privilege API keys: enable only futures trading + IP whitelist + withdrawals disabled; isolate each bot in its own sub-account. This is Freqtrade’s official security advice. Freqtrade Exchange Notes
- Paper trade first: Binance futures testnet (supported by Hummingbot), Bybit demo mode (supported by Freqtrade) — get it working before touching real money.
3.4 24/7 Operations
The bar is extremely low: Freqtrade needs a minimum of 2GB RAM / 2 vCPU; one overseas 2C2G VPS suffices (avoid Binance-restricted regions). Docker deployment + systemd/tmux supervision + NTP clock sync (a hard requirement — clock drift directly breaks exchange request signing) + Telegram alerts (Freqtrade ships the full /status /profit /forceexit command set). Freqtrade Installation Freqtrade GitHub
4. Where to Find Real Alpha (and Realistic Expectations)
4.1 The Realistic Way to “Scan Every Strategy on the Internet”
Not reading TradingView scripts one by one, but structured screening: Quantpedia indexes 1000+ strategies, 2000+ papers, and 800+ out-of-sample backtests, filterable by asset class / rebalancing frequency / in-sample vs out-of-sample performance, which you then batch-reproduce in a unified engine. Quantpedia Screener On GitHub, funding-rate arbitrage has ready-made open-source implementations (e.g. aoki-h-jp/funding-rate-arbitrage). TradingView community scripts are good for signal inspiration, not for live trading.
4.2 Validated Crypto Alpha Categories (Ranked by Retail Feasibility)
- Funding-rate / cash-and-carry basis arbitrage: a deterministic structure by mechanism. Academic research confirms crypto spot-futures dislocations exceed those in traditional FX, but they converge over time — the arbitrage is getting crowded. Fundamentals of Perpetual Futures (arXiv:2212.06888)
- On-chain data signals: ETH net inflows have 1–6 hour intraday predictive power for returns and volatility, with patterns significantly different from BTC. Return and Volatility Forecasting Using On-Chain Flows (arXiv:2411.06327)
- Momentum / cross-sectional momentum: of the 150+ academically documented anomalies, nearly all concentrate in illiquid small-caps and ignore costs, decaying sharply after publication — the same applies to small-cap crypto: “paper backtest ≠ obtainable after fees.” Market anomaly — Wikipedia
- Market making: retail is constrained by latency and inventory management; only low-frequency quote-based market making is feasible, with tiny capacity. Deep RL in Cryptocurrency Market Making (arXiv:1911.08647)
Counterexample warning: TVL, once a widely trusted on-chain fundamental, was found to be “surprisingly irrelevant” to token returns — no independent alpha. The Surprising Irrelevance of TVL (arXiv:2506.03287)
4.3 The Research Pipeline (Pitfalls Flagged at Every Step)
| |
- Overfitting defenses: cap the number of parameter searches, fix the out-of-sample window, write the “number of attempts” into every backtest report (the MinervaScore idea); pick parameters from the heatmap’s “plateau,” not its spikes.
- Lookahead bias: run Freqtrade’s
lookahead-analysisto catch future functions before anything else. - Portfolio level: pairwise correlation of daily returns across crypto coins is about 60% — multiple coins are not diversification; multiple strategy logics are (funding arb vs trend vs mean reversion). Correlation without Factors (arXiv:2412.04263)
Realistic expectations: most strategies will fail; a few low-capacity edge strategies may yield thin profits; excess returns come mainly from structural premia (funding, basis, liquidity provision) rather than predictive power. The better results under rigorous academic out-of-sample protocols reach 44.55% annualized with a 1.55 Sharpe — treat that as the ceiling reference, not the retail baseline. From Hypotheses to Factors (arXiv:2604.26747) Reframing the goal from “predicting direction” to “harvesting structural premia” raises survival odds by an order of magnitude.
5. LynxCrypto: The Development Prompt I’ll Hand to an AI
The prompt below is my construction blueprint for the next step — I’ll throw it at an AI coding agent (Claude Code / Kimi Code) to build my quant system from scratch.
| |
6. Next-Step Action List
- Change the Martingale grid’s sizing multiplier back to 1 and add the circuit breaker — this is the only urgent change all the research in this post implies for my existing position.
- Set up the Python environment + CCXT + vectorbt, and get ZECUSDT data pulling working.
- Kick off the project with the LynxCrypto prompt, delivering M1 first.
- Abandon the “800→1000 daily” objective function; replace it with “maximize expected return subject to max weekly equity drawdown < 10%.” Keep the withdrawal discipline (withdraw profits as they come), but move the anchor from “$200 a day” to “positive months.”
- Log daily: what parameters were tried, how many backtests were run — write the “number of attempts” into every backtest report, as a guard against self-deception.
Appendix: Method and Core Sources
Method: four parallel deep-research tracks covering [grid/Martingale math], [the 15-min range strategy], [tech stack selection], and [alpha methodology], closely reading 40+ primary sources (arXiv papers, official exchange docs, official framework docs, GitHub API empirical data), with key numbers labeled “fact / inference / opinion.” The liquidation table in Section 1.2 is computed from a self-built model (inference; mmr=0.5% is optimistic, so real liquidation is even closer).
Core sources (the full 40+ are linked inline in each section):
- Martingale (betting system) — Wikipedia — optional stopping theorem and losing-streak probabilities
- P&L Calculations (Futures Grid Bot) — Bybit — official per-grid profit formula
- Introduction to Futures Martingale Bot — Bybit — the official account of Martingale mechanics and risks
- Grid Trading: How It Works and Where It Breaks — Audacity Capital — grid failure modes and risk-control checklist
- Keltner Channels / ADX — StockCharts ChartSchool — standard channel parameters and regime thresholds
- Bollinger Bands — Wikipedia — academic evidence on Bollinger validity (including contrarian usage)
- Freqtrade official docs / Exchange Notes — the Binance One-way hard constraint, API permission minimization
- Hummingbot Binance connector — Hedge mode + testnet support
- vectorbt / CCXT — backtesting and exchange middleware
- Why and how systematic strategies decay (arXiv:2105.01380) — quantifying strategy decay
- MinervaScore (arXiv:2608.23808) — 2026’s strong evidence that “pretty backtest ≠ future performance”
- Day trading — Wikipedia — the baseline fact that 97% of retail traders lose
- Fundamentals of Perpetual Futures (arXiv:2212.06888) — convergence of funding arbitrage
- What Are Funding Rates — Cube Exchange — the funding mechanism and mark-price liquidation coupling
Information gaps (honest disclosure): official Binance/OKX fee figures could not be scraped this time (anti-bot); there is no direct literature on “15-min range-quantile entries” (ORB is the closest academic counterpart); no public empirical work decomposes stop-and-reverse costs at the crypto 15-min level; treat everything labeled “inference” in this post accordingly.
End of Part 2. If LynxCrypto gets up and running, there will be a third post: live field reports.
Related reading: Part 1 · LynxCrypto Sets Out: From a 200-Grid Martingale Bot to the Hunt for Real Alpha