← Back to the general documentation

Laboratory guide

How to test your trading ideas on real data, save them and make them trade by themselves, one or several at once. It is simulated money for educational purposes: none of this is investment advice.

What the Laboratory is

The Laboratory is a test bench for your trading ideas. Before risking anything, you see what would have happened with that idea over the last years of BTC, ETH and SOL, costs included. Everything is computed in your browser on real candles since 2020 (1 hour, 4 hours and 1 day). If you like it, you save it and can enable it so it trades by itself in your simulated account.

1 · Ideaa mix of botsor a rule2 · Backtestwhat would have3 · Saveup to 20 strategies4 · Enabletrades by itself inyour simulated accountSeveral strategies at once → “Portfolio” tab
The usual path: test an idea, save it and, if you like it, enable it.
  • Mix bots: combine pieces of the bots on the leaderboard to build your own mix.
  • Build with indicators: write a rule with indicators (for example “buy when RSI is low and volume is high”).
  • Portfolio (several at once): test and enable several strategies together in the same account.

You need an account to enter. Everything is simulated money for educational purposes: a good result in the past guarantees nothing in the future.

Mixing bots

A mix is made of ingredients (up to 4). Each ingredient starts from a bot on the leaderboard (bots are listed by competition month and, inside each month, by their rank) and has six aspects you can adjust:

AspectWhat it decidesOptions
SignalWhen to buy and when to sellTrend following, mean reversion, moving-average cross, breakout, Donchian, average filter, buy and hold, random…
DirectionWhether it only buys, only sells or does bothLong and short · Long only · Short only
SizeHow much it investsFixed · Volatility-adjusted (with a yearly % target)
LeverageHow many times your capital it can moveFrom 0.25× to 3×
RebalancingWhen it readjusts the positionAlways · With band · Minimum threshold (with a % change)
BrakeWhether it steps aside after losing a lot from its peakSee The brake
LeaderboardbotIngredient 1 · weight 60 %☑ Signal☑ Direction☑ Size☑ Leverage☐ Rebalance☑ Brake☐ unticked = that aspect stays neutralIngredient 2 · weight 40 %up to 4 ingredients, each with its own aspectsMix
Each ingredient starts from a bot and has six aspects you can tick or untick; ingredients add up according to their weight.

Each aspect has a checkbox: unchecked means neutral (the aspect “does not exist” for that ingredient). The signal is mandatory. Opening “Adjust this ingredient” lets you pick each aspect's option directly.

Weights and budget

A · 40 %B · 30 %C · 20 %10 %Account split↔ drag the dividers to move capital between neighbours (5 % steps)unassigned
Each colour is a strategy; the hatched part is unassigned capital. The total never goes over 100 %.
  • Weights. One bar splits 100 % among the ingredients. Drag the dividers; each ingredient has at least 5 %.
  • With a single ingredient the weight does nothing. It is always 100 % (there is nobody to share with, which is why the bar has no dividers), so it does not change what the strategy does. What does act is the budget below, and it combines with the leverage the recipe already has: with Investment cap the strategy trades with its own leverage and is only cut if it asked for more than the cap (recipe 2× and cap 1×: it never goes above 1×; with a cap of 2× or more, nothing changes); with Use all the leverage the whole strategy is scaled so that its maximum matches the cap (recipe 2× and cap 3×: everything is multiplied by 1.5; recipe 2× and cap 1×: by 0.5). With several ingredients, the weight multiplies what each one asks for before they are added.
  • Budget. Two ways to size the mix: Investment cap (each ingredient invests according to its own recipe and, added up with their weights, you never go above the cap) or Use all the leverage (it is scaled so that, with every ingredient at the maximum of its recipe, you land exactly on the cap). The cap goes from 0.25× to 3× your capital.
  • Over several assets and candle sizes. You can tick several assets and several candle lengths: the same mix is tested on each combination (up to 12) and you get a comparison table. If it only works on one combination, it is probably chance.
  • Cost per trade. 0.07 % by default (fee plus slippage).
Investment cap (cap 1.5×)now 0.9×capeach ingredient by its own recipe; the mix may stay below the capUse all the leverage (cap 1.5×)all at maximum = 1.5×it is scaled so that, with every ingredient at the maximum of its recipe, you land exactly on the cap0×1×2×3×
In the first mode the mix may stay below the cap; in the second it is scaled to land right on it.

How to read the result

You get a chart (your mix, each ingredient and buy and hold) and a table with: total result, return per year, maximum drawdown, quality (Sharpe ratio), position changes and time invested, plus a year-by-year breakdown. Look more at the maximum drawdown and whether it wins in several years than at the total: one spectacular year is usually luck.

“Surprise me” and “Random”

300 random mixeswin in the searchand keep winning in validationthe best one↓ and it is checked once on the final slice, which nobody looked at
Every step discards candidates. Even so, the best one may be down to luck: that is why the final slice matters.
  • Random builds a random mix without checking anything.
  • Surprise me (30 per season, mixes and rules together, one every 2 minutes) tries many random mixes (300, or 120 with 1-hour candles; 1 to 4 ingredients each, with different signals, settings, weights, cap and budget, and across the assets and candles you have ticked) and then refines the best ones by changing one detail at a time. Only those that pass a filter count: they must win in the search period and keep winning in the next one. Among them it picks the one that ranks best overall on four measures: Sharpe, total result, yearly return (higher is better) and largest drop (lower is better): the candidates are ranked on each measure and the best combined position wins. Whatever you had built is replaced by what it finds.
  • Three time slices. The first 60 % of the history is the search period; 60 % to 80 % is validation (the candidate must hold up); the last 20 % has never been looked at and shows as “After (NOT used in the search)”. That last row is the one that really counts.
  • Limited use. It is an expensive search: there is a wait between searches (120 seconds) and a daily maximum per user (30). If it finds nothing, it says so: that is normal, finding something that holds up is hard.
Search · 60 %Validation · 20 %Final · 20 %hundreds of ideasare tried herethe candidate mustkeep winningnever looked at:the real testPastToday
The “After (NOT used in the search)” row of the table is the blue slice: the only one that could not influence the choice.

Building with indicators

Here you write a rule with indicators: “when it is true, open a trade and hold it for N candles”. A rule has 1 to 8 conditions joined by AND (“both at once”) or OR (“one is enough”). Each condition compares an indicator with a value:

  • Greater than / Less than a number.
  • Between two numbers.
  • Zone: the indicator is split into slices holding the same amount of data (quartiles) and you choose in which ones it acts. Example: “the 25 % of moments with the lowest volatility”. When saved, zones become exact numeric ranges, so the server uses the same figures you saw.
cond. 1cond. 2cond. 1cond. 2AND: both at onceOR: one is enoughthe rule is true only in the middletrue anywhere in the green
With “AND” the rule is true less often (stricter); with “OR”, more often.
Zone 1 · the lowest 25 %zone 2zone 3zone 4low indicator valueshigh valuesEach zone holds the same amount of data (a quartile)that is why the zones at the ends are wider and lower
You choose in which zones the rule acts. When saved, zones become exact numeric ranges.

You also choose the holding time (H candles), whether it is a buy or a sell rule, and the costs (fee and slippage). The rule works like this, the same as live: when it is true on a closed candle, it enters at the open of the next one, holds for H candles and exits; there is only one trade at a time and no new entries are looked for while it is open.

rule true ✓enters at thenext openholds it H candles (here H = 4)exitsWhile the trade is open no new entries are looked for: there is only one at a time.
When the rule is true on a closed candle, the trade opens at the start of the next one and closes H candles later.

The final test

The result you see while building the rule uses the first 70 % of the history. The “Check with new data” button tests it on the remaining 30 %, which had not been looked at. Do it only once: if you repeat it changing the rule until it works, you are fitting it to that slice and it no longer counts as a test.

Starting ideas and “Surprise me”

There are classic ideas ready to load (oversold with high volume, rebound after a sharp fall, trend following, euphoria with “OR”, compressed market). “Surprise me” tries hundreds of random rules (260 with 1-hour candles, 700 with 4-hour, 900 with 1-day) and keeps the best one that wins after costs in the search period and in the next one.

The 38 indicators

FamilyIndicators
TrendDistance to the simple moving average (%); Distance to the exponential moving average (%); MACD histogram (% of price); Slope of the average (% over 10 candles); ADX · trend strength; Direction: DI+ minus DI−; Aroon oscillator; Consecutive up (+) or down (−) candles
MomentumRSI · relative strength; Stochastic %K; Stochastic RSI; CCI · commodity channel index; Williams %R; Momentum: change over N periods (%); MFI · volume-weighted RSI
VolatilityATR · average candle size (%); Bollinger %B position; Bollinger band width (%); Volatility of returns (%); Parkinson volatility (%); Volatility ratio: short / long
VolumeRelative volume; Volume Z-score; OBV · accumulated pressure (normalized); CMF · Chaikin money flow; Distance to the rolling VWAP (%)
Candles and priceCandle body (%); Upper wick (%); Lower wick (%); Opening gap (%); Position within its range (0–100); Distance to the N-period high (%); Distance to the N-period low (%); Price Z-score
TimeHour of day (UTC); Day of week (0 = Monday … 6 = Sunday)
Other assetsBTC momentum over N periods (%); Strength relative to BTC (% points)

Each indicator has its parameters (for example, the period of the average). Their definitions are the Laboratory's, and the server computes them exactly as the browser does: automated tests check it against six years of real data.

The brake

The brake is a protection of each ingredient. When the ingredient falls more than X % from its peak, a warning trips: it spends some days in cash and its peak is reset. Three settings:

  • Fall % and days in cash after each warning.
  • Warnings until it is retired (3 by default): on reaching that number, the ingredient is retired and stays in cash.
  • Never retire it: there is only the pause after each warning; the ingredient always comes back.
  • If retired, it trades again after N days (0 = never comes back). When it returns, warnings and the peak start from zero.
123← peakpause: some days in cashpauseretired: cashfall of X % from the peak = warningwith “comes backafter N days”: dashedlineGrey = the ingredient is stopped. After 3 warnings (default) it is retired; with “Never retire it” there are only pauses.
The grey bands are the ones the Laboratory draws on the chart when an ingredient is stopped by the brake.

Why is my chart flat?

Almost always because the brake retired the ingredient: it has not traded since, and the line stays horizontal for years. With assets that often fall 20-50 % (like BTC) three warnings come quickly. The chart shows it with grey bands (grey background when every ingredient is stopped; with several ingredients, also a strip in its colour at the bottom) and a notice under the chart explains it. If you do not want it retired for ever, tick “Never retire it” or set it to return after some days.

Risk limits on the chart (the red X)

In the competition, an account that loses more than 5 % in a day (against the previous day's close, 00:00 UTC) or more than 10 % from its highest close is blocked. The Laboratory applies the same rules to your mix or portfolio and, on the first day it would break them, draws a red X on the chart and warns you:

That day your account would have been blocked and you would have been out.
00:00 UTC00:00 UTC00:00 UTC00:00 UTC−5 % against yesterday's closethat day the account wouldhave been blocked: out of the competitionnothing is stopped here
Equity is compared with the previous 00:00 UTC close (−5 %) and with the highest close (−10 %).

Nothing is stopped here: the mix keeps going and the result does not change, so you can see how it would have ended. Only the first breach is marked because, in a real competition, the account would not trade after that day. If a good result has an early red X, in the competition you would never have got to see it.

Saving, exporting and importing

Editoryour mix or ruleSavewith a nameExport.json fileImporthere or in another accountAn enabled strategy cannot be deleted or overwritten: disable it first.
The exported file is marked as a TapeArena strategy and is fully validated on import.
  • Save. Enter a name and press save. You can keep up to 20 strategies. A mix stores its ingredients, weights, budget, costs and the assets and candles you studied; a rule, its conditions, holding time, direction and costs.
  • Names. Two strategies cannot share a name (you can overwrite one). An enabled strategy cannot be deleted or overwritten: disable it first.
  • Export and import. Each strategy downloads as a JSON file (marked as a TapeArena strategy) that you can import here or hand to someone else. On import everything is validated; a malformed file is rejected with a message.
  • Load. “Load” brings the strategy back to the editor so you can change it.

Enabling a strategy

Enabling a saved strategy makes it trade by itself in your account with simulated money. The server evaluates it, not your browser, so it keeps running with the page closed.

A candle closesof its lengthThe server evaluatesyour strategyOpens, adds, reduces orcloses ITS trades(origin “Strategy”)🔒 Your manual trades and your conditional ordersare never touchedIt works with the page closed: the server evaluates it, not your browser.
The strategy only manages the trades it opens itself.
  • Budget or weight: 5 % to 100 % of your capital. With 50 % and a mix that wants to invest 100 %, the strategy keeps half of your capital open in that asset.
  • Market. If you studied it on several assets or candles, you choose one for it to trade (only one at a time).
  • When it decides. Every time a candle of its length closes. When you enable it, it is evaluated right away on the latest closed candle.
  • Mixes. They compute the position they want; a change under 5 % is not traded. If they ask for less, they close only the difference (partial close, starting with the most recent trade); if they ask for more, they add; if they switch side (buy to sell), they close and open the other way.
  • Rules. When true on a closed candle they open a trade with your budget, hold it H candles and close it, one at a time. They do not enter on a stale signal: if the candle closed more than 25 % of its length ago (plus a minute), they wait for the next one.
  • Only their own trades. Each trade carries the origin “Strategy” with the name; the strategy only touches its own. It never touches your manual trades or your conditional orders, and it is subject to the same risk limits as you.
  • Disabling closes that strategy's trades. In “Trade” you see the “Strategy running” card with its last evaluation, the next one and its position.
Current position100The strategy now wants60Only the difference is closedcloses 40It starts with the most recent trade. Fees are paid only on what is closed.
A change under 5 % is not traded. If it switches side (buy to sell), it does close everything and open the other way.

Several strategies at once

You can have up to 5 strategies enabled at once in the same account. There are two modes, and they cannot be mixed:

By weightsBy priority
How it sizesEach uses a fixed % of your capital (5-100 %); weights add up to at most 100 %No weights: each uses its full recipe (100 %)
PriorityNot usedDecides when margin runs short (1 = most important)
Lack of marginThey do not compete: each has its shareSolved by the policy: wait or free margin
By weightsBy priorityA · 30 %B · 30 %C · 40 %each within its share of the account;they do not compete for margin1 · A · 100 %2 · B · 100 %3 · C · 100 %total marginif margin runs short the order decides:wait or free margin
They cannot be mixed: either weights rule or priority rules.

The shared margin

All the account's positions together cannot go over the maximum leverage (3× your capital; the server also keeps a 1 % safety margin). If a strategy wants to open or add and does not fit, it depends on its policy (priority mode only):

  • Wait: it does not open; it will try again at its next evaluation.
  • Free margin: it closes, fully or partly, trades of less important strategies, from the least important up, only if that is enough. If it would not fit even after closing all lower-priority ones, it closes nothing. It never touches your manual trades or those of a more important strategy.
Example

5,000 USDC account and a 3× cap (14,850 with the safety margin). A (priority 2) has 9,900 open. B (priority 1, “free margin”) wants to open 7,450. It is 2,500 short: B closes 2,500 of A and opens. If B were “wait”, it would not open. If A were the important one and B the secondary, B could not take anything from A and would wait.

5,000 USDC account · 3× cap = 14,850 with the safety margincapBeforeA (priority 2) 9,900B wants 7,450“Wait”A 9,900B does not open“Free margin” (B has priority 1)A 7,400B opens 7,450↑ A gives up 2,500It only closes if that is enough; it never touches manual trades or those of a more important strategy.
Worked example: B needs 2,500 more than fits, and only if it “frees margin” does it take them from A.

How to change it

The mode is chosen when enabling the first one and stays fixed while any is running; to change it you must disable them. “Settings” changes the weight (weights mode) or the priority and policy (priority mode). If you press “Enable” while another is running, it takes you to the Portfolio tab to split the account among all of them.

Portfolio: joint backtest

On the Portfolio tab you pick 2 to 5 of your saved strategies (mixes or rules) and see what would have happened had they traded together in the same account. The same rules as live apply:

  • Each strategy decides when its own candles close; everything is simulated on an hourly grid, over the period in which all have data.
  • Split by weights (visual bar with dividers you drag; the grey part is unassigned capital) or by priority (a number and a policy per strategy).
  • The margin is shared: editable maximum leverage (3× by default), with the wait or free-margin policies.
  • Changes under 5 % are not traded; rules are not resized while they hold their trade.
risk limitJoint portfolioStrategy A aloneStrategy B aloneBuy and hold BTCWhat would have happened with all at once
The portfolio (green, thick) against each strategy alone and buy and hold. The red X marks the first risk breach.

You get the chart (portfolio, each strategy alone and buy and hold BTC), the results table, the red X for risk limits and a what happened with the margin table: openings that did not fit, times one freed margin from others and times margin was taken from it. The “alone” strategies run at 100 % of their recipe, not with the assigned weight, to show what each one contributes.

The “Enable these strategies exactly as configured” button enables them all with the split you see (it first disables any that were running, after asking you to confirm).

Backtest versus live: what differs

The Laboratory tries to make what you see and what later happens the same, but there are differences worth knowing:

BacktestHistorical candlesfrom the archiveSimulationin your browser“What would havehappened” (approx.)LiveLive candlesfrom the marketThe server evaluateseach closed candleSimulatedlive trades≈ very close prices, not identicalAlso, the live brake can react up to 2 candles late.
The backtest is for deciding whether an idea deserves to be watched, not for knowing how much it will earn.
  • The data. The backtest uses historical candles; live, candles come from the competition's market. Prices are very close, not identical.
  • The live brake may react up to two candles late, because the return of the last two candles is not yet known when deciding.
  • An open trade keeps its units between evaluations: its weight in the account moves with the price until the next decision.
  • Small rebalances. Live, a change under 5 % is not traded; a single-mix backtest rebalances on every candle. That is why a portfolio with one strategy comes out a little different from the loose mix (in one test, 2.43× versus 2.50×).
  • Stale signals. Live, a rule does not enter if the candle closed a while ago; the backtest always enters.
  • Market impact. Market depth is not simulated: orders fill at the candle price plus a fixed cost.

So the backtest tells you whether an idea deserves to be watched, not how much it will earn.

Usage limits

WhatLimit
Ingredients per mix4
Conditions per rule8
Saved strategies20
Strategies enabled at once5
Asset and candle combinations per strategy12
Budget or weight5 % - 100 % (sum ≤ 100 % by weights)
Maximum leverage3×
“Surprise me” searches1 every 120 s and 30 per season per user (mixes and rules together)

Frequently asked questions

Why is my Laboratory chart flat?

Almost always because the brake retired the ingredient after several warnings and it has stayed in cash since. You can tick “Never retire it” or make it trade again after some days; the chart shows with grey bands when it is stopped.

What does the Surprise me button do?

It tries hundreds of random mixes or rules on the chosen asset and candle and keeps the best one that wins in the search period and keeps winning in the next. The “After” row is the slice that was never looked at. You have 30 “Surprise me” searches per season (mixes and rules together).

Can I have several strategies enabled at once?

Yes, up to 5. They are either split by weights (a fixed percentage of the account each, up to 100 %) or by priority (no weights, and if margin runs short the order decides). The two modes cannot be mixed.

What happens if there is no margin to open a trade?

In priority mode, according to its policy: wait (it does not open) or free margin (it closes what is needed of less important strategies, only if that is enough). It never touches your manual trades.

What does the red X on the chart mean?

That day the mix would have lost more than 5 % in a day or more than 10 % from its peak, the competition limits: the account would have been blocked. Nothing is stopped here, you are just warned.

Is the backtest result what I will earn?

No. It is what would have happened in the past, with costs but with historical candles that differ from the live market. It is for discarding ideas and watching the ones that hold up, not for predicting profits.

← General documentation · Open the Laboratory · API