/Sign in

Strategies

Write a strategy, read the backtest and the analysis report, tune, save versions, and manage them on the strategy page.

Contents

Write a strategy

  1. Say the idea: describe how you want to trade in one sentence. For finer control, add trading conditions and a backtest target, or start from a template.
  2. Filled in and backtested: the Agent turns the idea into a strategy spec, fills in what you left out, writes the code and runs the backtest. What it filled in can be checked on the board's "Spec" tab.
  3. Adjust in the conversation: from the backtest result, tell the Agent what to change; once you confirm, it updates the strategy and backtests again.
  4. Save a version: when you like the result, click "Save as version" on the board and the strategy goes into the strategy library.
The "Spec" tab: "Assumptions" lists what you left out and the Agent filled in

Why check the spec first: if the spec misread you, the code and the backtest follow it. Saying what is wrong is quicker than describing the idea again, for example:

Per-symbol comparison: after backtesting a multi-symbol strategy, say "backtest each symbol separately" and the platform runs each symbol on its own (up to 12 at a time) and lays the results out in one table beside the combined result. A single symbol's figures are not a slice of the combined result and do not add up to it.

A few common terms:

Spec

How the platform read your sentence: symbols, bar size, range, entry and exit rules, parameters

Strategy code

The code written from the spec; it is what the backtest runs

Version

A fixed snapshot in the library, V1, V2…; paper trading and contests only take versions

Read the backtest result

When the backtest finishes, the result shows on the "Result" tab:

The "Result" tab: platform flags at the top, the metrics below

Results and reports may carry "Platform flags": fixed rules that point out obvious problems such as a deep drawdown, too few trades or high costs. No flag does not mean the result is sound. Three flags need a second thought:

  • Nearly every trade closes on the next bar: the exit condition is probably always true; fix the exit before tuning.
  • In the market over 95% of the time with at most 5 closes: the exit may never trigger.
  • Spot cannot go short, short signals dropped: the result is only the long half of the strategy; to go short, switch to perpetuals.

How each metric is worked out and read:

Total return

Ending equity ÷ starting capital − 1, after fees and slippage; includes funding when perpetual funding is counted

Annualized

The total return scaled to a year. Over a short range it is inflated a lot, so read it with care

Max drawdown

The deepest fall from an earlier high, on equity at each bar's close; moves inside a bar are not seen

Sharpe

Mean ÷ standard deviation of per-bar returns, scaled to a year; risk-free rate taken as 0

Sortino

Like Sharpe, but only downside moves count as risk

Calmar

Annualized ÷ max drawdown

Volatility

Standard deviation of per-bar returns, scaled to a year

Benchmark

The return of buying and holding the benchmark over the same period. For roughly hedged long-short strategies the benchmark is cash (0%), with buy-and-hold shown for reference

Fills

Every fill counts: opening, adding and closing each count once, a reversal counts twice. Not the number of round trips

Win rate

The share of closing fills that made money, not counted by open-and-close round trips; P&L at fill prices, before fees and funding

Profit factor

Total of winning closes ÷ total of losing closes, before fees. Not average win ÷ average loss. Shows 0 when there are no losing closes

Time in market

The share of bars with a position

Funding

Funding settled on perpetuals in total; positive is received, negative is paid

US stock strategies

With the market set to "US stocks", a strategy is backtested in a US cash account, which differs from Binance in a few ways:

  • Long only, no leverage: a cash account cannot short, and positions never exceed the cash. For an idea that shorts, the agent asks whether to make the Binance perpetuals version or a long-only US version.
  • Whole shares: target positions are scaled to the cash and rounded down to whole shares; a small account buying an expensive stock may round to 0: when nothing traded for that reason the run asks for more capital or a cheaper stock, and a partial case is flagged on the result.
  • No funding, no commission by default, slippage as set.
  • On the trading calendar: one daily bar per session; intraday sizes are 5-minute, 15-minute and 1-hour, with bars only inside the session, so time conditions in a strategy follow the session. Weekends and holidays have no bars.
  • Range: without a stated range the last year is used; the end is at most the last closed session (the platform tops the data up every morning), and the assumptions say so.
  • Price basis: split-adjusted; dividends are paid as cash on the ex-date to the shares held, before tax, and one declared in another currency is converted to US dollars at the ECB reference rate on the ex-date; the assumptions carry this sentence. A backtest on a US file you uploaded has no such sentence: the file's prices are traded as they are.
  • The benchmark is SPY; a benchmark bar with no close carries the previous close, which the result flags.
  • Symbols: up to 20 US tickers, or the platform's pools us_top100 / us_top500.
  • Shorting and the margin account: a strategy whose request shorts or goes long and short is backtested in a margin account — gross exposure (longs plus shorts) at most 2x the capital as set, cash never below zero; a short pays a borrow fee of 0.25% a year (by calendar day at the last close) and, when dividends are paid, the gross amount in lieu on the ex-date; a name is shorted only on a day when, by its own daily bars through the previous close, its real price is at least $5, it has traded 30 sessions and its 30-session average dollar volume is at least $34.5M (before July 2024 there is no market-wide volume, so those sessions are checked on the first two alone, and the result flags it) — other days' short signals are held back and flagged in the result; at every close the equity is held against 25% of the longs plus the larger of 30% and $5 a share on the shorts, and a shortfall is met at the next open, longs sold first, then shorts covered (fill reason "margin call"). A long-only strategy stays the cash account, unchanged.

A US strategy version can run as a daily paper account, see US accounts; it can enter a contest only in a long-only season, see How a contest works.

Read the analysis report

The analysis report takes the backtest result apart: where the returns came from, where it lost, and whether it still holds under other conditions. Click "Analyze the result" in the conversation, or "analyze" on the strategy page, to get one.

Top: "analyze" on a version card on the strategy page makes the report, and its summary shows above the button (in a conversation it is "Analyze the result" on the board); below: an analysis report: the verdict first, then a reading by performance, risk and robustness (the picture keeps only the first point of each); each point's "refs" can be opened to show its sources

The report opens with two judgements:

  • Verdict: strong, acceptable, weak or reject.
  • Robustness: the backtest is run again under several conditions, with an overall call of robust, fragile or incomplete. The four checks:

In-sample vs out-of-sample

Whether the two halves agree

Doubled costs

Whether it still makes money with fees and slippage doubled

Parameters ±20%

Whether nudging the parameters breaks it

Drop one symbol

Dropping each symbol in turn, whether the return turns negative or shrinks a lot; skipped for a single symbol or a preset universe

Each point in the report ends with "refs ▸"; open it to see which figures that sentence cites.

What "Headline figures" adds beyond the backtest result:

Beta

Sensitivity to the benchmark's moves

Alpha

Annualized excess return after taking out what follows the benchmark

Annual turnover

How many times average equity is traded in a year

Annual cost drag

A year's fees as a share of starting capital; slippage is already in the fill prices and not counted here

Tuning

Tuning tries many parameter sets on the same stretch of history to find a better one. Not every tier has it: you need "tuning jobs" under "Includes" on Settings → Points, see Tiers and points.

Start: click "Tune parameters" on the board and choose how many sets and the method (model-proposed, grid, random, adaptive); or say it in the conversation, such as "tune 24 sets" or "only tune a few parameters (name them)".

When a backtest misses a target you set, the reply offers "Tune to meet the target"; click it to tune toward the target. To keep a parameter fixed, untick it under "tune" on the "Params" tab. Before it runs, an approval card shows the estimated time and how many backtests it uses.

Read the result: results are on the "Tuning" tab; the first row is the parameters before tuning, each row below is a candidate, and the "rank" column is its place on the whole backtest. The platform also compares the last stretch of the backtest range on its own, to see whether a candidate still beats the parameters before tuning there:

  • With a target set (such as a max drawdown limit), every candidate shows whether it meets it.
  • A candidate better over the whole range but worse in the last stretch is marked as likely overfit (▽). With a target the bar is higher: the candidate must meet it in the last stretch too, and if the parameters before tuning also meet it, the candidate must beat them there. Ones clearly weak in the last stretch are marked ◇.
  • Candidates whose equity falls too far are dropped early and marked in the table.
  • If no candidate wins over both the whole range and the last stretch, the platform's conclusion is to keep the parameters you had; if the last stretch cannot be compared on its own, it only says "not confirmed" and draws no conclusion.
The results table on the "Tuning" tab: the first row is the parameters before tuning; a green ▲ beats them, an orange ◇ is clearly weak in the last stretch

Adopt: click "Adopt" on a candidate in the board's result table, or say "adopt c3" or "adopt the recommended" in the conversation; after you confirm, a backtest runs with those parameters and becomes the current strategy, ready to save.

Refine: after reading the result, say in the conversation:

c3 is a candidate's number in the result table. The platform tries another round near it.

Save as a version

A strategy in a conversation reaches the library only when you "Save as version". Each save is a new version, V1, V2…, and earlier versions stay as they were; if the code and parameters have not changed, nothing new is saved.

"Save as version" at the top of the board, in the same row as "Analyze the result" and "Tune parameters"

Why save a version: the strategy in the conversation keeps changing as you edit it. Paper trading, contests and backtests on the strategy page need a fixed piece of code so results can be matched.

The strategy page

Open a strategy in "Strategies" to see all its versions, each with return, Sharpe, max drawdown and fills. For each version:

Run backtest

Backtest again with the version's saved parameters; you can change parameters and fees on the right, and the fees apply to this run only

analyze / tune

The result opens on the run page in a new tab

make current

Save the earlier version again as the newest one and make it current, after confirming

rename version

Changes only the display name

delete

Deletes this version. A version still used by a submission in this season cannot be deleted before the season settles

The strategy page: the version card on the left, where analysis, tuning and paper trading start ("Submit to contest" appears once you join a season); the parameters on the right
  • Edit the code: click "edit" in the code area and, when done, "Save as V3" (the number moves on by itself) to save a new version; the earlier one is unchanged. Run a backtest again and the result belongs to the new version.
  • Back to the conversation: click "open conversation" to return to the conversation the strategy was saved from.
  • Rename: the strategy name can be changed, and the new name works in conversations; paper accounts already open keep their names.
  • Archive: a strategy cannot be deleted, only archived. Archived strategies leave the list and the Agent no longer draws on them; you can restore them at any time. A strategy still used by a submission in this season cannot be archived before the season settles.

Build on an earlier strategy

Say in the conversation:

The Agent finds the strategy you mean and carries its code, parameters and backtest settings into this conversation to work on. You can name it by name, version number or symbol; an archived strategy has to be restored in the library first.