← All ideas
#043ExitSwing

Random entry, ATR trailing stop and equal risk: testing where the edge really is

Tom Basso's experiment: a coin-flip entry, a trailing stop at 1-2 ATR and the same percentage risk on 20 futures, 1000 runs. The card describes how to repeat the experiment reproducibly and use it as a benchmark for your own entry.

The Algorithmic Advantage · Tom Basso · Watch video

Markets

Futures, Commodities, Indices, Bonds, Forex

Timeframe

D1

Data

OHLC

Rules

Partly formalised

Difficulty

Medium

Status

Untested

Some rules were added by us and are marked in the text.

TradingView needs data or workarounds
EasyLanguage has pitfalls
MetaTrader 5 has pitfalls

Idea in brief

Tom Basso wanted to show how little the entry point matters. Basso took 20 futures, about 10 years of daily data, and replaced the signal with a coin. If there is no position at the daily close, flip a coin: heads buy in the morning, tails sell. From there a mechanical trailing stop at 1 or 2 ATR manages the position (Basso does not remember exactly which). Size is set by the same percentage risk of current equity.

A single coin-flip run proves nothing, so Basso ran a loop of 1000 runs and averaged the results. According to the author, every such series produced a profit on average. Basso's conclusion: the obsession with entries is overrated, and the work is done by the exit, position size, diversification and thousands of trades.

This card is not about a trading system. It is an experiment and a benchmark: you can compare any entry against it and see whether it adds anything beyond the exit and the sizing.

Why it might work

Basso's logic goes like this. The job of a trend system is to be in every big move, and today's collapse could have been caught by any signal that went short the day before yesterday or on Friday. A trailing stop quickly cuts trades that went the wrong way and keeps those that went our way. Equal risk keeps a single trade from ruining the result, and 20 markets give enough trades for the advantage to show.

The Finetiq caveat matters more than the conclusion itself. If prices have no trends, an exit rule by itself does not create positive expectancy: on a random walk the average result of such a system is zero before costs and negative after. So the profit in Basso's experiment is the trends that existed in these 20 markets over these years, collected by the trailing stop. The experiment shows that the entry is not the main thing for a trend system on trending markets. It does not follow that "the entry does not matter at all".

Rules

Experiment (author, Finetiq parameters)

// daily bars, each market in the portfolio is calculated separately
IF MarketPosition = 0 at the daily close
    U = Coin(Seed, MarketId, BarDate)           // Finetiq: random number 0..1, see the block below
    IF U < 0.5 THEN BUY AT NEXT BAR OPEN          // author: heads, buy in the morning
    ELSE            SELL SHORT AT NEXT BAR OPEN   // author: tails, sell

ATRn = ATR(21)                     // Finetiq: 21, like the ATR in the author's Keltner
k    = 2                           // author: "1 or 2 ATR", does not remember exactly

// the trailing stop only moves in the direction of the trade (author: "trailed behind price")
Long:  Stop = MAX(Stop[1], Close - k * ATRn)     // Finetiq: from the bar close
Short: Stop = MIN(Stop[1], Close + k * ATRn)
SELL STOP at Stop    // long
BUY STOP at Stop     // short
// after the stop is hit there is no position, and at the next close the coin is flipped again (author)
// no target: exit only by the stop (author)

Position size (author, Finetiq percentage)

RiskMoney = Equity * 0.5%                          // author: the same % of current equity
                                                   // Finetiq: 0.5%, like the starting risk in the author's current trading
Contracts = floor(RiskMoney / (k * ATRn * PointValue))
// Finetiq: Equity = closed trades + open profit across all markets, calculated before each entry
// Finetiq: if Contracts = 0, the trade is skipped and the skip counter is written to the report

Reproducibility: seed, many runs, distribution (Finetiq)

// 1. the coin as a function of (seed, market, date), not the next call to a generator
Coin(Seed, MarketId, BarDate) = Hash(Seed, MarketId, BarDate) / HashMax
// a sequential generator breaks comparison: a different exit gives a different number of trades,
// and all subsequent coin flips shift. A hash gives the same flip on the same day with any exit

// 2. series of runs
FOR Seed = 1 TO 1000
    run the whole portfolio
    record: net result after costs, CAGR, MaxDD, number of trades, % winners, result by market

// 3. read the distribution, not the average
Median, P5, P95 for the net result and MaxDD
ShareProfitable = share of runs with net result > 0 after costs

// 4. comparing variants: the same 1000 seeds, only one rule changes
//    (stop multiplier, sizing, market list). The difference is calculated pairwise for each Seed

Applying it to the turtle-4w-2w card

// A: turtles as is. Entry on a 20-bar breakout, exit on a 10-bar extreme, equal risk
// B: the same exit and the same risk, coin-flip entry, Seed = 1..1000
Percentile = share of B runs whose net result is worse than A's
// A above the 95th percentile of B: the 20-bar breakout adds an edge beyond the exit
// A in the middle of B's distribution: the result comes from the exit and the sizing
// Finetiq: in B the coin is flipped only on days when A could also have entered (no position),
// otherwise B spends more time in the market and the comparison is unfair

Parameters

Parameter Value Source
Markets 20 futures author
History about 10 years, daily bars author
Entry coin flip at the close with no position, filled in the morning author
Exit trailing stop at k ATR, no target author
Multiplier k 1 or 2 author (does not remember exactly)
ATR period 21 Finetiq (as in the author's Keltner)
Trailing calculation from the close, only in the direction of the trade Finetiq
Risk per trade the same % of current equity author
Risk percentage 0.5% Finetiq (starting risk in the author's trading)
Number of runs 1000 author
Series result average author
Series result in the card median, 5th and 95th percentiles Finetiq
Source of randomness hash of seed, market and date Finetiq

What to test

  1. Distribution after costs. Repeat the 1000 runs with commission and one tick of slippage on entry and exit. Look at the median and the share of profitable runs, not the average: a few lucky seeds pull the average up.
  2. Control on data without trends. Shuffle the daily price changes of each market and run the same 1000 seeds. The profit should disappear. If it stays, the code has look-ahead or a stop calculation error.
  3. Multiplier and ATR period. k = 1, 2, 3 and periods 10, 21, 50 on the same seeds. With k = 1 there are several times more trades, and costs weigh more.
  4. Sizing. Equal percentage risk versus one contract per market, same seeds. This shows what part of the result comes from size and what part from the exit.
  5. Periods and markets. Split the history into 5-year segments and run them separately. Then 1, 5 and 20 markets. Basso relied on a portfolio: on a single market the spread across seeds will be huge.
  6. Benchmark for your own strategy. The scheme from the "Applying it" block: where your system's result lies in the distribution of a random entry with the same exit and the same time in the market.

Platform notes

TradingView (Pine Script)

  • math.random(min, max, seed) with a fixed seed gives a repeatable sequence. But it is a sequential generator: with a different exit the coin flips will shift. For pairwise comparison, calculate your own hash of the seed and time.
  • A strategy trades only the chart symbol, and there is no portfolio testing (section 5 of the reference guide). The 20-market experiment cannot be repeated in Pine, only one market at a time.
  • The strategy tester has no built-in sweep of input parameters. 1000 seeds by hand is unrealistic, so export the trades and build the distribution outside the platform.
  • The trailing stop in strategy.exit(trail_points, trail_offset) is set in ticks. An ATR stop is more reliably passed as a price via stop =, recalculated on every bar. ta.atr uses Wilder smoothing.

MultiCharts and TradeStation (EasyLanguage)

  • The built-in Random function takes only an upper bound, has no seed parameter, and the same sequence between runs is not guaranteed. For reproducibility, write your own generator from a Seed input, market number and date, for example a linear congruential generator on integers within double precision.
  • The 1000 runs are done by optimizing the Seed input from 1 to 1000: the optimization report is the table of results by seed.
  • A portfolio of 20 markets with shared equity is needed for the "percentage of current equity" rule. That means Portfolio Maestro or Portfolio Trader. Check whether your version of the portfolio module supports input optimization, otherwise export the trades for each seed.
  • AvgTrueRange is a simple average of TrueRange, not Wilder. Set the stop as a price: Sell next bar at StopPrice stop, and send the order on every bar.

MetaTrader 5 (MQL5)

  • Generator: MathSrand(Seed) in OnInit and MathRand(). For pairwise comparisons the same hash of seed, symbol and bar date as on the other platforms is better.
  • The Seed sweep from 1 to 1000 is done by optimization in the tester. You need a full sweep: the genetic algorithm will skip some seeds.
  • The tester's multi-symbol mode lets one EA handle 20 symbols. The broker must have all the markets, and CFDs on futures often have less than 10 years of history.
  • iATR is a simple average of TR. Lot size from risk: SYMBOL_TRADE_TICK_VALUE, SYMBOL_TRADE_TICK_SIZE, rounding to SYMBOL_VOLUME_STEP. On a small account many trades will round down to zero lots.

Where the idea can break

  • Basso calls this way of trading silly and believes indicators add a little value. It is a demonstration, not a strategy.
  • There are no figures. We only know that the average over 1000 runs was positive. The interview does not say what the spread was, what the worst run and the drawdown were, or whether costs were included. Basso gives the number of years from memory.
  • The result depends on the trends in these particular 20 markets over a particular decade. On another period or on markets without persistent trends, a random entry with a trailing stop can give zero or a loss after costs.
  • The stop multiplier is not known exactly. Between 1 and 2 ATR the number of trades and the weight of costs differ several times over.
  • The random system is almost always in the market: after a stop the position is opened again the very next day. Comparing it with a strategy that spends most of its time out of the market without aligning exposure is not valid.

Sources

Author's claims

These figures and statements are the author's. We have not verified them.

  • Tom Basso ran the experiment on 20 futures markets and, from memory, about 10 years of data. Basso averaged each series of 1000 random runs, and every time the average was a profit. The return, drawdown, costs and spread of results were not given.
  • Basso currently opens a position with a risk of about 0.5% of equity and lets a winning position grow to 1% risk.

Related ideas

Updated: 2026-09-10