Bentrix Docs
HomePricingDashboard

Generated markets

Markets Bentrix makes from a recipe — calm, trending, choppy, jumpy, a wave, or several that move together — with no download, and the same prices to the last tick on every computer.

01What a generated market is

A generated market is made by Bentrix from a recipe: a handful of settings (how volatile it is, whether it trends or chops, how heavy its tails are, when it trades…), a seed, and the generator's version. The same recipe gives the same prices, to the last tick, on every computer. So a market can be sent to someone else as one line of text, and they practise on exactly what you practised on.

Every generated market's name starts with SYN-, never a real market's name. A SYNTHETIC pill on its workbench says plainly that it is not a real market.

It is the quickest way to start: nothing to download, no broker, no account to connect. You also get markets with exactly the character you want to practise on:

  • a steady trend, to learn to stay in a winning trade;
  • a choppy range, to learn to stay out;
  • sudden jumps, to learn where a stop really fills;
  • a market that switches between calm and storm, to learn that one setting does not suit every day.

02The laboratory of generated markets

There is one laboratory of generated markets on a computer. Make it from ☰ › File › New laboratory, then Generated markets, and make a workbench in it as in any laboratory.

You choose the account when you make the laboratory, as with any laboratory: its currency, opening balance, leverage, hedging or netting, and the time zone its candles are cut in (see the account).

A generated market's days are made when a workbench first needs them, a few seconds a day. They are then kept on this computer like any recording, so going back over them is exact, and they cost nothing until you play them. A ten-year market takes no room until you open its first day.

03Making a market

In the workbench's Market Watch, press + and choose New generated market…. The sheet reads from top to bottom in the order you decide:

  1. What kind of market: a preset to start from (below). Every control after this starts from the preset's values.
  2. Its name and seed. You type the word after SYN- (letters, digits and -). New seed draws another seed: the same settings with another seed give another market of the same character, the way two days of one real market differ.
  3. How it moves: five controls, each a plain word with its unit (below).
  4. Advanced: the rest, folded until you open it.
  5. With whom: Independent, or Moves with the group (below).
  6. What it looks like: a preview drawn by the generator itself, with each day's regime under it. It is the market you will get, not an illustration.
  7. Create keeps the recipe and puts the market on the workbench.

Copy the recipe puts the recipe's text on the clipboard. Paste a recipe someone sent you in the field beside Use this recipe.

The presets

PresetCharacterWhat it is for
CALM7 % a year, slightly fat tails, mild volatility clustering, a small gap at the week's openA quiet market to learn the mechanics: orders, stops, sizing
TREND10 % a year, a strong upward drift (40 % a year), minute momentum 0.15Staying in a trade that keeps going
RANGE9 % a year, strong mean reversion (0.35 of the distance a day), choppy minutes (momentum −0.2)Fading the edges, and learning when breakouts fail
JUMPY12 % a year, a jump about every two and a half days, fat tailsWhere a stop really fills, and position size against gaps
REGIMESThree regimes: quiet (calm, about 15 days), trend (about 8 days) and crash (three times as volatile, falling, about 2 days)One strategy across different market states
SINEA smooth sine wave, four hours a cycle, almost no noiseSeeing exactly what an indicator does to a known shape
SAWA sawtooth, one hour a cycle, no noiseThe same, with sharp turns

Every preset trades the currency week (Sunday 22:00 to Friday 22:00 UTC), quotes five decimals from 1.1, starts on 2024-01-01, has a spread of 8 points at the busiest hour and about 30 ticks a minute.

How it moves: the five controls

For a market-like recipe (every preset but the two waves):

ControlWhat it doesRange
Volatility, % a yearHow far prices wander: the yearly standard deviation of its returns. 7 is a calm currency pair, 60 a lively crypto market0 to 499
Drift, % a yearA steady pull up (above 0) or down (below 0)any
Mean reversionThe share of the distance back to its anchor price closed each day: 0 none, 0.35 a strong range, 1 all of it0 to 1
Minute momentumHow a minute follows the one before: above 0 it trends, below 0 it chops−0.9 to 0.9
Jumps a daySudden moves a day on average; 0.4 is one every two and a half days. Turned on, a jump is about 0.4 % in size0 or more

For a wave (SINE, SAW): the shape (Sine, Cosine, Square, Sawtooth, Triangle, Tangent), the Period in minutes (one whole wave), the Amplitude (half the swing, in price), the Trend a day (price added each day by a straight line under the wave) and the Noise (a minute's random move around the wave, in price).

Advanced

ControlWhat it does
Start priceThe first price, with up to 8 decimals
Ticks a minuteTicks a minute on average at the busiest hour, up to 600. Quieter hours have fewer
First dayThe day the market begins, YYYY-MM-DD. Nothing exists before it
Trading hoursSunday to Friday, all day (the currency week), Every day, all day (as a crypto market), or New York, 09:30 to 16:00 (an equity session, Monday to Friday)
Fat tailsLarge moves more often. A lower number is fatter: 4 is very fat, 10 nearly normal, 0 the normal curve
Clustering, reaction and Clustering, memoryCalm days follow calm days and wild days wild ones. Reaction is how much one day's shock raises the next day's volatility; memory is how long that lasts. The two must sum under 1
Gap at the week's open, %The typical size of the jump between Friday's close and Sunday's open
Busier when Asia, London and New York openOn (the default): the market is busier and wilder as the sessions open, quietest between them, and the spread widens as it quiets

The spread you set is the spread at the busiest hour. Bentrix widens it as the market quiets, so a generated market's cost behaves like a real one's through the day.

04Markets that move together

A market can be Independent, or move with a group. Markets of one group share factors: motions common to the whole group, such as a dollar factor that every dollar pair feels. Each member says how strongly it follows each factor, with a sign. EURUSD falls when the dollar rises; USDJPY rises. The rest of each market's motion is its own.

On the sheet:

  • How alike, −1 to 1: the market's correlation with its group's factor.
  • Late by, minutes: the market follows the factor this many minutes late, so one market leads and another follows.
  • Baskets: a group made in one press from the gallery (below).
  • Together in volatile regimes (0 to 1): how much more the group moves together when a regime is more volatile. Markets do this in a crash: everything falls at once.
  • Correlation drifts: Stays, Slowly or Quickly. With drift on, how alike the markets move changes over time, so no month is like another, as with real markets.
  • Factors, under Advanced: each factor the group shares, this market's loading on it, and Add a factor. A factor also has its own size × (2 makes its motion twice as large for this market), its active hours (All day, Asia, London, New York or Overlap: the factor moves most then, the day's total unchanged) and its multiple in a regime × (a crash that pulls the group together harder is a multiple above 1 there).
  • Correlation, as the loadings give it: the matrix of correlations the settings imply between this market and the group's kept markets. Type a value in With {market} and the sheet fits this market's loadings to reach it, as far as the group's factors allow. When they cannot reach it, it says Reached 0.62 of 0.80: the group's factors allow no closer. The markets already kept never change: a kept market is never edited, because a changed recipe is a new market.
  • Measure five days generates five days and measures the correlation the markets actually had. It differs from the implied one by chance, the drift and the regimes, and that difference is what a person sees in real markets too.

When a day of a group closes, the Journal writes the correlation it realised, and the day's regime.

BasketMarketsWhat it is
USD majorsSYN-EURUSD, SYN-GBPUSD, SYN-AUDUSD, SYN-USDJPY and SYN-EURJPYFour dollar pairs on a dollar and a risk factor, and a cross computed from two of them
Crypto majorsSYN-BTCUSD, SYN-ETHUSDTwo always-open markets on one crypto factor, volatile (60 % and 75 % a year)
Two marketsSYN-A, SYN-BTwo markets on one factor, the simplest pair to practise spread trading on

A derived cross

A derived market is computed from two others at every instant. SYN-EURJPY in the USD majors basket is SYN-EURUSD × SYN-USDJPY, rounded to its own decimals, with its ask never below its bid. A cross can also be a division: a EURGBP-like cross is the EURUSD-like leg ÷ the GBPUSD-like one, bid over the other's ask. A derived cross is exact, so it cannot be arbitraged against its legs. With a basis, it carries a small difference of its own that returns to zero (basis points is its size, basis reversion how fast it closes, 0 to 1 of it a minute): a deliberate, bounded mispricing to practise triangular trading on.

05The recipe as text

A recipe is a line that starts with bentrix-recipe: and goes on in JSON. Copy the recipe gives it; anyone who pastes it has the same market. Its identity is a short hash of the recipe. A market's name is kept with its identity, so a name already kept with other settings is refused: a changed recipe is a new market, and gets a new name.

The sheet shows the settings most people need. Everything a recipe can say is in its text: the regimes, a jump's size, the anchor of mean reversion, a wave's phase, several waves together, a derived cross. To use one of those, copy a recipe, edit its text, and paste it back. A recipe Bentrix cannot render is refused with the reason in one sentence, for example momentum between -0.9 and 0.9.

This is a whole recipe, laid out on several lines for reading:

{
  "version": 1,
  "seed": 42,
  "market": "SYN-CHOPPY",
  "digits": 5,
  "start_price": 1.25,
  "start_day": "2024-01-01",
  "hours": "fx_week",
  "spread_points": 10,
  "ticks_per_minute": 40,
  "process": {
    "kind": "market",
    "volatility": 0.12,
    "drift": 0.0,
    "mean_reversion": 0.2,
    "momentum": -0.3,
    "jumps_per_day": 0.2,
    "jump_size": 0.004,
    "tails": 5,
    "clustering_shock": 0.08,
    "clustering_persistence": 0.88,
    "regimes": [
      {"name": "quiet", "volatility": 0.6, "mean_days": 10},
      {"name": "storm", "volatility": 2.5, "momentum": 0.1, "mean_days": 3}
    ],
    "sessions": true,
    "weekend_gap": 0.002
  }
}

Every field

FieldMeaningAllowed
versionThe generator's version the recipe renders under (below)1, 2 or 3
seedThe seed. Another seed is another market of the same characterany whole number
marketThe name: SYN- and your wordmust begin SYN-
digitsDecimals of a price; the step is 10 to the minus this0 to 8
start_priceThe first priceabove 0
start_dayThe first day, YYYY-MM-DDa real day
hoursfx_week (Sunday 22:00 to Friday 22:00 UTC, the default), always_open, or us_equities (Monday to Friday, 09:30 to 16:00 New York)one of the three
spread_pointsThe spread at the busiest hour, in points0 or more
ticks_per_minuteTicks a minute at the busiest hour, on averageabove 0, up to 600
processWhat the moves are made of: {"kind": "market", …}, {"kind": "wave", …}, {"kind": "waves", "waves": [ … ]} or {"kind": "derived", …}
membershipThe group it moves with; absent is Independent

A market ("kind": "market"):

FieldMeaningAllowed
volatilityYearly volatility as a fraction: 0.08 is 8 % a year0 to under 5
driftYearly drift as a fractionany
mean_reversionThe fraction of the distance to the anchor closed a day0 to 1
anchorThe price it reverts to; the start price when absentabove 0
momentumThe minute returns' autocorrelation: above 0 trends, below 0 chops−0.9 to 0.9
jumps_per_day and jump_sizeJumps a day on average, and a jump's typical size as a fraction (0.004 is 0.4 %)0 or more
tailsFat tails, as the degrees of freedom of a t distribution; 0 is the normal curve0, or 3 and up (1 and 2 are taken, but their moves are not scaled to the market's volatility)
clustering_shock and clustering_persistenceVolatility clustering (a GARCH(1,1) on each day's shock): reaction and memorythe two sum under 1
regimesThe market's states (below); empty is one calm state
sessionsBusier as Asia, London and New York opentrue (default) or false
weekend_gapThe gap at the week's open, as a fraction's standard deviation0 or more

A regime is a state the market stays in for mean_days days on average (5 when absent), moving to another state at random. Its own drift (a yearly fraction added in that state), its volatility (a multiple of the market's), its reversion (a multiple of the mean reversion) and its momentum (added to the minute momentum) apply while it lasts. The REGIMES preset is quiet, trend and crash. Each day's regime is said under the preview and on the workbench.

A wave ("kind": "wave"): shape (sine, cosine, square, sawtooth, triangle, tangent held to three periods' worth so it never runs to infinity, or chirp with end_period_minutes, a sine whose period glides to that over a week), period_minutes, amplitude (half the swing, in price), phase_degrees, trend_per_day and noise (a minute's random move, in price). Several waves ("kind": "waves", version 2) add up around the one start price, each with its own shape, period, amplitude, phase and trend.

A derived cross ("kind": "derived", version 2): legs (the two generated markets' names), op (multiply or divide), basis_points and basis_reversion (0 to 1).

A membership:

FieldMeaningAllowed
groupThe group's namea name
loadingThe correlation with the group's one factor (version 1), or with a factor called main−1 to 1
lag_minutesMinutes the market follows the factors late0 or more
factorsNamed factors, each {"factor": "dollar", "loading": -0.75} (version 2)each −1 to 1
pairsA factor shared with one other market only, {"with": "SYN-GBPUSD", "loading": 0.2} (version 2), for a correlation the group's factors cannot reacheach −1 to 1
couplingHow much more the market follows its factors in a more volatile regime (version 2)0 to 1
driftWhether the loadings drift over time: none, slow or fast (version 2)
factor_settingsPer factor: sigma (its size, a multiple above 0 and at most 5), regimes (a multiple per regime's name, at most 5) and hours (24 weights, one per UTC hour) (version 3)

The shared part of a market's motion (the squares of its loadings added up) must stay under 0.98: some of every market's motion is its own.

06Same on every computer, for ever

Every random draw is made from a stream named by the market, the day and the kind of draw, never from a running sequence. Every price is an exact count of points. So any day can be made on its own, in any order, and comes out the same: day 300 made first is the same day 300 as after days 1 to 299.

The generator's version is part of the recipe. When the generator's method improves, the version goes up and the old method is kept, so a recipe made under version 1 renders version 1's prices for ever:

  • Version 1: one factor per group; every preset.
  • Version 2: named factors, pair factors, regime coupling, drifting correlation, lag, several waves and the derived cross. The basket gallery is version 2.
  • Version 3: a factor's own size, its multiple per regime and its active hours.

A recipe from a newer version than your Bentrix knows is refused by name, for example this recipe was made by generator version 4; this build renders up to 3.

07From a program or an AI assistant

Everything on the sheet, and everything a recipe can say, is a tool an agent or a program calls: generated_lab_create, generated_recipes (the presets and the kept recipes), generated_preview, generated_recipe_read and generated_recipe_write (a recipe's text to its settings and back), generated_market_create, generated_basket_create (a gallery basket, or your own members with a correlation matrix the fit approximates), generated_correlation, generated_generate (make days now) and generated_episode (a market per reinforcement-learning episode, named SYN-<name>-S<seed>). The SDK guide on generated markets walks through them in all nine languages.

08Good to know

A strategy that does well on generated markets has proved nothing about any real market. Generated markets are for learning the mechanics and testing an idea safely. They are not for judging an edge.

The preview, Measure five days and the tools that preview or measure generate what they show and keep none of it.

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed