Appearance

Personalize your experience

Mode
Accent Color
Direction
Anti-Martingale

Anti-Martingale

Anti-Martingale

Linear-inverse anti-martingale — shrink size with depth.

At a glance

Engine value
anti_marti_grid
Size at level i
size(i) = base / (i+1)
Family
Anti-Martingale — Size shrinks deeper into — capital protection first.
Risk band
Low risk
Capital profile
-like — total = base × Σ1/(i+1).
Best for
Trending markets; strict capital protection.
Orders per level
One entry order and one take-profit per level.
Ladder cost @ 10 levels
2.02× base lot
Versus a flat ladder
0.20× the capital
Deepest rung
0.09× base (0.18× the first rung)
Entry orders resting
10 at 10 levels
Break-even bounce
6.72% from the deepest fill (flat ladder: 5.00%)

What this curve is for

The reference decay : size is 1/(i+1), so each rung deeper commits less. It inverts the martingale bet — instead of paying more to insist the market comes back, it pays less the further the market goes, on the theory that a move which has already persisted is more likely to continue than to reverse.

How the sizing rule works

Size at level i is 1/(i+1). Because the engine floors executed size at one lot, the drawn keeps decaying while the traded ladder flattens out at the minimum lot after the first few rungs. The total ladder cost is therefore bounded in practice and nearly bounded in theory.

LevelPer-order sizeOrdersLevel totalCumulativeEntry priceTake-profit
L10.50×10.50×0.50×99.0099.99
L20.33×10.33×0.83×98.0098.98
L30.25×10.25×1.08×97.0097.97
L40.20×10.20×1.28×96.0096.96
L50.17×10.17×1.45×95.0095.95
L60.14×10.14×1.59×94.0094.94
L70.13×10.13×1.72×93.0093.93
L80.11×10.11×1.83×92.0092.92
L90.10×10.10×1.93×91.0091.91
L100.09×10.09×2.02×90.0090.90
Reference configuration: 10 levels, 1% apart, 1% target, base price 100, long. Sizes are in base-lot units.

The ladder, as the engine builds it

Below is the 's own ladder and the trading terminal's chart engine, both driven by buildLadderPlan for this . Change the level count, spread or target and the rung prices, sizes, and chart lines recompute exactly as they would in the .

base lot 100 USDT · long · no stop

Ladder shape — Anti-Martingale

LONG · base 100.00 (illustrative) · 10 levels stepping down · 1% apart

Base positionEntry rung (buy)Init target
Opening position & init targets200 USDT
T2
target 2 sell @ 102.00
+2 USDT
T1
target 1 sell @ 101.00
+1 USDT
L0
Market buy · 2 lots @ 100.00
200 USDT

Targets are stacked above the opening buy because a long grid exits higher than it enters.

Entry ladder

Limit buys below the base · L1 nearest, L10 deepest · every amount in USDT

Entry ladder: one row per rung, showing entry and exit price, size, order count, notional, margin, running capital and profit at exit.
LevelSize curveEntry buyUSDTExit sellUSDTFrom base%Sizebase lotsOrdersNotionalUSDTMarginUSDTCum. capitalUSDTProfit at exitUSDT
L1100%99.0099.991.00%0.500×150502500.5
L267%98.0098.982.00%0.333×133.3333.332830.33
L350%97.0097.973.00%0.250×125253080.25
L440%96.0096.964.00%0.200×120203280.2
L533%95.0095.955.00%0.167×116.6716.673450.17
L629%94.0094.946.00%0.143×114.2914.293590.14
L725%93.0093.937.00%0.125×112.512.53720.13
L822%92.0092.928.00%0.111×111.1111.113830.11
L920%91.0091.919.00%0.100×110103930.1
L1018%90.0090.9010.00%0.091×19.099.094020.09
Levels 1–10 of 10
1 / 1
Ladder cost 2.02×Capital 402 USDTAvg entry 98.01Cycle profit 5.02
Loading the chart engine…

What depth costs

The series grows so slowly that adding levels is almost free. This is the family that lets you cover an enormous adverse range on a budget — coverage becomes a design choice rather than a funding negotiation.

LevelsLadder costDeepest rungEntry ordersCost vs 5 levelsCoverage
5 levels1.45×0.17×51.00×5%
10 levels2.02×0.09×101.39×10%
20 levels2.65×0.05×201.82×20%
40 levels3.30×0.02×402.28×40%
Ladder cost is Σ of every rung in base-lot units, excluding the opening L0 batch. At a grid size of 100 USDT, the 10-level ladder commits 202 USDT of notional at 1× leverage.

Read the cost vs 5 levels column as the escalation test. A flat ladder doubles when the depth doubles; anything materially above that is a whose coverage has to be bought rather than simply configured.

Capital budgetLevels affordableAdverse move covered
10× base200 levels200.0%
25× base200 levels200.0%
50× base200 levels200.0%
100× base200 levels200.0%
250× base200 levels200.0%
How far price can move against the grid before it runs out of rungs, per capital budget, at 1% spacing. This is the question a funding decision actually turns on.

Averaging and recovery

With every rung , the volume-weighted average entry is 96.05 against a base of 100 and a deepest rung of 90.00 — so the average sits 40% of the way down the covered range. Getting back to flat from the bottom therefore needs a 6.72% , against 5.00% for a flat ladder of the same depth — 1.72% more work.

ExcursionLevels filledDeployedAverage entryMarkUnrealisedBounce to flat
Shallow dipL1–L31.08×98.2397.00-0.01×1.27%
Half the ladder fillsL1–L51.45×97.5595.00-0.04×2.69%
Full ladderL1–L102.02×96.0590.00-0.13×6.72%
Reference configuration: 10 levels, 1% apart, 1% target, base price 100, long. Sizes are in base-lot units. Deterministic arithmetic, not a simulation: no assumption is made about how price reached each depth.

Size shrinks with depth, so the deepest rungs barely move the average entry. Sitting through a sustained adverse move is cheap, and the total ladder cost is bounded no matter how many levels you add. The cost of that safety is recovery speed: there is little size down low to average with, so a deep unwinds slowly. The engine floors executed size at one lot, so past a certain depth the is flat in practice even though the formula keeps decaying.

Where the exposure sits

Held by the shallowest quarter
53.6% of total size
Held by the deepest quarter
15.0% of total size
Unrealised loss at full fill
0.13× base (6.2% of deployed capital)
Profit if every rung books its target
0.02× base
One shallow cycle, against reserved capital
24.8 bps

The last row is the metric that separates modes. Profit for a full cycle is the target of deployed capital in every , so it cannot discriminate. What differs is how much capital has to sit reserved to earn one shallow cycle: this mode 2.02× base to collect 24.8 bps of it when the first rung completes.

Which market pays this curve

Trending and markets. If the makes sustained one-way moves punctuated by shallow retraces, decay harvests the retraces while refusing to fund the trend.

Reduces size as price moves against you, so losses on deep levels are . Capital-protective and trend-friendly; recovery is slower because deep levels barely move the average. Floored at 1 lot.

The shape of the risk

Recovery risk, not capital risk. The deepest rungs are too to move the average entry, so if price does revert you climb out slowly, and the shallow rungs — at the worst prices relative to the eventual bottom — dominate the position.

ℹ
Note:Identical math to `` — the two names exist so dashboards can group by family.

Run it over real history

This is the product's grid backtester, not a summary of one. It fetches public candles for the you pick, rebuilds the ladder on the first candle of the , then applies the engine's own fill, take-profit, and stop-loss rules bar by bar. The caveat block inside the is part of the output — read it before trusting a number.

Instrument

BTCUSD

delta-india

Anti-Martingale · 10 levels @ 1% · target 1% · 100 USDT / level · 1× · long · no stop

What this does not model

  • Exact intrabar ticks. Bullish/doji candles use open → low → high → close; bearish candles use open → high → low → close. Finer timeframes reduce sensitivity to this deterministic assumption.
  • Queue position. Limit orders are assumed filled when touched, which flatters a maker grid in fast markets.
  • Margin rejection and liquidation. Deep rungs fill here even if the account could not fund them — check the capital requirement.
  • Slippage and funding. Only the fee you set above is charged; funding, borrow and slippage are absent.

Run the ladder over real history

The grid is rebuilt anchored on the first candle of the window, then the engine's own fill, exit, refill and stop-loss rules are applied bar by bar. You get the real fill sequence for this configuration on this instrument.

Measured against other modes

First the arithmetic, then the market. The below is computed from the size curves alone; the underneath replays every one of those ladders over the same real candle , with grid_mode as the only variable.

ModeLadder costDeepest rungBreak-even bounceEntry ordersShallow cycle
Anti-Martingale (this mode)2.02×0.09×6.72%1024.8 bps
Fixed10.0×1.00×5.00%1010.0 bps
Square-Root Decay4.32×0.30×5.85%1016.4 bps
Exponential Decay1.00×0.00×8.90%1050.0 bps
Linear Martingale55.0×10.0×2.38%551.8 bps
Reference configuration: 10 levels, 1% apart, 1% target, base price 100, long. Sizes are in base-lot units. Peers are chosen from this mode's own direction plus the flat baseline, so the comparison is meaningful rather than decorative.

Nothing is precomputed here. Press run and the backtester fetches one candle window and replays 5 ladders across it — identical settings, identical bars, grid_mode as the only difference.

When to use it

  • Trending markets where you expect the adverse move to continue rather than revert.
  • Strict capital protection mandates.
  • Very deep ladders where you want coverage measured in tens of percent.

When to avoid it

  • Range-bound instruments where averaging down is the entire .
  • You need the ladder to pull the average entry down meaningfully.

Tuning

  • Spend the capital saved on depth and spread: decay curves are built to cover wide ranges.
  • If the one-lot bites within three rungs, either raise the base lot or choose a shallower decay (square-root or ).

Running it in production

  • Watch how quickly executed size hits the one-lot — beyond that extra levels add coverage but almost no averaging.
  • Track realised cycles per day. Decay curves earn from frequency, so a falling cycle count is the signal that the market has left the .
  • Check the gap between average entry and . Decay curves keep it wide by design, so recovery expectations must be set from it, not from hope.

How it fails

  1. 1
    Floor collapse
    Executed size hits the one-lot minimum almost immediately, so the configured stops describing the ladder. the 's per-level sizes against the venue's minimum lot before deploying.
  2. 2
    Slow recovery
    After a deep excursion the average entry sits close to the shallow rungs, so a partial retrace books little. This is the designed trade-off, but it surprises operators who expected "safer" to also mean "faster".

Claims worth correcting

“Anti-martingale is martingale run backwards, so it profits from trends.”

It does not profit from the trend; it merely refuses to fund it. The profit still comes from retraces completing take-profits.

Interaction with the rest of the configuration

  • Pairs naturally with trailing: light deep rungs make following the trend cheap.
  • Spread sets how fast the ladder consumes depth. Widening it buys coverage for the same level count at the cost of fewer .
  • Target sets what each cycle books. Below -trip fees plus slippage, a grid is a fee generator regardless of the .
  • The is the only bound on the tail. Without it, the 's worst case is whatever the market does, not what you planned.

Questions this mode raises

  1. 1
    Is this the same as harmonic?
    Yes — identical math. Both names exist so dashboards and mandates can group the by the family they think in.

Where these numbers come from

  • Sizes and capital: levelMultiplier / gridModeCurve in lib/grid/gridModes.ts, from grid_modes.hpp and the Python engine's lot calculator.
  • Rung and exit prices, , init targets and the stop line: buildLadderPlan — the same builder the and use.
  • Backtest , cycles and P&L: runBacktest / runBacktestSweep over public broker candles, applying the engine's fill, exit, and stop rules.
  • Price charts: the trading terminal's chart engine, with the ladder drawn through its own price-line API.
!
Caution:A backtest is evidence about one , not a . Fees are charged at the rate you set; slippage, funding, , margin rejection and are not modelled. For a growth especially, a profitable window mostly tells you the window did not contain the trend that would have tested it.

Related

  • 1.Grid Modes — Overview — The full taxonomy and how to choose
  • 2.Anti-Martingale family — What every curve in this family has in common
  • 3.Capital Allocation — Sizing an account to a Anti-Martingale ladder
  • 4.Stop Loss — Bounding this curve's tail
  • 5.Reading the Ladder Plan — Verifying the curve before deploying
  • 6.Grid Structure — Levels, init batch and base size

Related articles

  • Exponential Decay

    Automation / Grid Modes / Anti-Martingale

    Exponential Decay explained: how it works in QuaTick, settings and worked examples. Part of the Automation / Grid Modes / Anti-Martingale reference.

  • Geometric Decay

    Automation / Grid Modes / Anti-Martingale

    Geometric Decay explained: how it works in QuaTick, settings and worked examples. Part of the Automation / Grid Modes / Anti-Martingale reference.

  • Half-Slope Inverse

    Automation / Grid Modes / Anti-Martingale

    Half-Slope Inverse explained: how it works in QuaTick, settings and worked examples. Part of the Automation / Grid Modes / Anti-Martingale reference.

  • Inverse Fibonacci

    Automation / Grid Modes / Anti-Martingale

    Inverse Fibonacci explained: how it works in QuaTick, settings and worked examples. Part of the Automation / Grid Modes / Anti-Martingale reference.

  • Linear Subtractive

    Automation / Grid Modes / Anti-Martingale

    Linear Subtractive explained: how it works in QuaTick, settings and worked examples. Part of the Automation / Grid Modes / Anti-Martingale reference.

  • Logarithmic Decay

    Automation / Grid Modes / Anti-Martingale

    Logarithmic Decay explained: how it works in QuaTick, settings and worked examples. Part of the Automation / Grid Modes / Anti-Martingale reference.

  • Square-Root Decay

    Automation / Grid Modes / Anti-Martingale

    Square-Root Decay explained: how it works in QuaTick, settings and worked examples. Part of the Automation / Grid Modes / Anti-Martingale reference.

  • Anti-Martingale family

    Automation / Grid Modes / Families

    Size shrinks as the ladder deepens. Capital protection first, recovery second.

  • Harmonic

    Automation / Grid Modes / Harmonic

    Harmonic explained: how it works in QuaTick, settings and worked examples. Part of the Automation / Grid Modes / Harmonic reference.

Browse all knowledge base articles →