Automated strategies
Build a strategy from blocks, in code or with Kara AI, put it to the test on real data, optimise it without overfitting, then connect it to an account with its guards.
9 min read · Version 1.2.51 · updated 29 September 2026

- Build a strategy in the block builder, or in code
- Read a simulation report and its verdict, criterion by criterion
- Run an optimisation that does not manufacture a fake result
- Connect a version to an account, with its guards
- Understand what is free and what is paid in compute tokens
The four pages
| Page | What it is for |
|---|---|
Algorithms | The workshop: the strategy is assembled from blocks, whose code is generated, or imported from a file. Each save creates a version. |
Simulation | Replays a version bar by bar on real data, fees included, then puts it through statistical tests. |
Optimization | Sweeps the settings and keeps the centre of the largest plateau, never the peak. |
Execution | Connects a frozen version to a trading account, with guards that belong to the account. |
A Documentation page, in the same section, describes the language of coded strategies. Example strategies are offered to get started: open one, read it, change it.
Build from blocks
A strategy reads left to right, in time:
- Core
- What applies to the whole strategy: the traded assets (the same logic applies to each, with its own position), the timeframe, and the decision moment: at the close of each bar, or on every quote.
- Stages
- One or several columns of conditions. With two stages, the first must have happened before the second.
- Execution
- What happens: entry, exit, trailing stop, break-even. An execution block acts once per signal, never on every bar where the signal stays true.
Condition blocks come in families: indicators (moving-average cross, RSI, MACD, stochastic, Bollinger, trend strength, Supertrend, volatility, indicator comparison), price action (structure trend and break, liquidity sweep, FVG imbalance, order block, retracement, candle pattern), key levels (previous high or low, time range, range breakout, price level) and context (session, days of the week, position, floating gain, time in position).
- Confluence
- Between two columns, it combines several signals: "2 of 3" lets the signal through as soon as two inputs are true at the same time. Giving a block a second input creates one.
- Validity
- An event (a cross, a break) lasts one bar. Its validity keeps it true for a few bars, long enough for the next stage to happen.
- Optimisable parameter
- A setting marked ◆ in a block's advanced settings. It is what optimisation will vary: with no declared parameter, there is nothing to optimise.
To link two blocks, drag from an output port, or click it and then the target; drop in empty space to create the next block. The builder's shortcuts are in the appendix.
Write in code
In Code file mode, drop a TypeScript file of 200 KB at most. It default-exports defineStrategy({ name, params, indicators, onBar, onTick? }): indicators come from ind (ema, rsi, atr, bollinger…), orders from ctx (buy, sell, exit, moveStop).
A strategy can declare secondary assets: they are loaded over the same period, aligned bar by bar on the main asset, and their positions held on the same account. The report merges everything, then shows each asset separately.
Kara AI
The Kara AI button opens an assistant that builds the strategy from your description, in your own words: it places the blocks, links them and checks that it is ready to simulate. Every setting stays editable by hand, and each change by the assistant can be undone in one click.
Critical reviewasks it for a demanding quant's opinion: the hypothesis the strategy plays, the risks of over-optimisation given your edits and your simulations, the tests to run, and a verdict.- Each exchange is paid in compute tokens, at the model's real cost. A daily limit applies.
- The assistant can be wrong: review the strategy and simulate it before trading. Nothing it says is investment advice.
Simulate
A simulation replays one precise configuration, bar by bar, on real data and fees included. It is the moment of truth for a setting, not the search for the best one. Before running, set:
- Account
- Starting capital, leverage and maintenance margin. Leverage caps the notional; below the maintenance margin, the position is liquidated.
- Sizing
- Fixed units, fraction of capital, fixed risk at the stop, fractional Kelly or volatility targeting. Fixed risk at the stop makes the strategy independent of price and capital.
- Execution
- What the simulator assumes when OHLC does not tell everything: when stop and target are both touched in the same bar, the cautious policy keeps the stop. It is the only one that does not manufacture profit.
- Precision
- At candle level, execution reads OHLC. At tick level, it reads the main asset's real quotes: the order of prices decides, and the spread paid is the market's at that moment. Forex, metals and indices have their quotes; crypto only has its trades, over a few weeks per run.
- Analyses
- Quick: split, Monte Carlo, robustness, costs and chance. Full: the same plus walk-forward and cross-validation, much longer.
The report's tests
- In-sample / out-of-sample
- The period is cut in two: the strategy is judged on the first part, then replayed on the second, which it has never seen. A setting that does not hold out of sample does not hold.
- Walk-forward
- A series of windows: on each, the best settings are chosen on the past, then replayed on the following period. The stitched curve of those periods is the only honest curve in the report.
- Combinatorial cross-validation
- Every combination of training and test groups, with an embargo between them. It gives the probability of overfitting: below 0.2, the selection is reliable; above 0.5, the in-sample ranking predicts nothing.
- Confidence intervals
- Each metric recomputed a thousand times on block resamples. If the lower bound of the Sharpe is below zero, the result is compatible with no edge at all.
- Robustness
- Each parameter shifted around its value. A real edge is a plateau; an isolated peak is overfitting.
- Cost sensitivity
- The strategy replayed at 0.5×, 1×, 2× and 3× the fees. If the edge dies at 2×, it does not exist: real costs always exceed the backtest's.
- Monte Carlo
- The order of trades shuffled thousands of times, trades skipped at random. The 95th-percentile drawdown is the one to plan for, not the backtest's.
- Desynchronisation
- Candles re-cut at other times: same prices, different slicing. A robust edge survives; a timing artefact does not.
- Against chance
- Hundreds of random strategies, with as many trades and as much time in position. Below the 95th percentile, nothing distinguishes yours from a coin toss.
- Prop firm
- The strategy replayed in Monte Carlo under a challenge's rules (target, daily loss, drawdown, time limits, then funded account): the probability of each stage, and which rule each failure comes from.
Optimise
Optimisation varies the declared parameters and measures each combination. It keeps the centre of the largest plateau, never the best peak: a setting that survives its neighbours has a chance of surviving the future.
- Search method
Grid: try everything, exact but expensive.Random: a sample of the space.Guided: a coarse sweep, then tightened around what stands out. Bayesian (TPE) and differential evolution learn from previous trials.- Objective
- The measure being maximised: Sharpe favours regularity, profit factor tolerates irregularity, PnL only looks at the finish.
- Minimum trades
- A setting that does not reach enough is not ranked.
Execute
The Execution page connects a frozen version of a strategy to an account and an asset. You need:
- a current version that compiles;
- a MetaTrader account linked through a Kara terminal with the master password, or a Rithmic account;
- a plan that includes the copier (Copier or Complete): execution goes through the same mechanism.
You then set the account guards, which the strategy has to obey whatever its code:
- Risk multiplier
- From 0.1 to 3. At 2, gains and losses double.
- Maximum daily loss
- Once reached, it pauses the strategy.
- Maximum drawdown
- Once reached, it stops the strategy. 15% by default.
- Simultaneous positions
- From 1 to 50.
- Short selling
- Off by default: the strategy only takes long positions until you allow it.
- On stop
- Whether to close open positions when the strategy stops.
- Up to 20 active connections; a given strategy connects only once to a given account and asset.
- Pause, resume and stop are driven from the page, and each action is logged.
Last heartbeatshows when the engine last confirmed it was following the connection. - If the account can no longer trade for a reason only you can fix (archived account, read-only link), the strategy pauses and resumes only if you restart it. If it is temporary (broker briefly refusing trading), it waits and resumes on its own.
Compute power and tokens
- Free: simulations and analyses on Kara's servers, in a shared queue with limited slots.
- Paid, in tokens: optimisation and the Kara AI assistant.
- One token = one second of one CPU core. When you send a run, an increased reservation is taken from your balance; at the end, only the time actually measured is charged and the surplus comes back. Nothing starts if the balance does not cover the reservation.
| Amount excl. VAT | Volume bonus | Tokens |
|---|---|---|
| €10 | — | 240,000 |
| €25 | +10% | 660,000 |
| €50 | +20% | 1,440,000 |
| €100 | +30% | 3,120,000 |
| €250 | +40% | 8,400,000 |
A purchase ranges from €10 to €500 excluding VAT; applicable VAT is added on the invoice. Payment uses the card saved in your settings. Before each run, Kara shows its estimated cost and the share of your balance it represents.
You can also connect your own compute servers, up to five: an agent installed on the machine connects to Kara with its token and fetches your runs, with no port to open. Runs on your servers consume no tokens.