Running a strategy on the simulated account

The Auto strategy panel runs one of your saved strategy scripts against the simulated evaluation account on this machine. It decides once per closed bar and can never reach a broker.

Senzoukria · Documentation · Updated September 2026


Where to find it

Where
Replay → trading dock → "Auto strategy" panel
Default
"Manual — no strategy" — nothing runs until you pick a script
Cadence
One call per closed bar; the forming bar is excluded
Window
Up to 600 closed bars are handed to the script, newest first
Account
The simulated evaluation account only — the platform routes no orders to a broker

What it does

The panel lists every script saved with kind "strategy". Pick one and it is mounted against the chart's bars. Each time a new bar closes, the script's decide() function is called once with the closed bars, the current simulated position, the tick size and a state object it carries from bar to bar.

The script returns a decision, never an order. The mount translates that decision into calls on the simulated account store: open at market, or flatten. It imports no connection module and no broker API, so a strategy has no path to a live account — a bot here is a paper-trading bot, and that is the only thing it can be.

The status line under the selector shows the running state, the number of decisions taken so far and the last decision. A blocked decision and a script error each get their own line.

The decision a strategy returns

Fields of the object returned by decide(), as the mount reads them
FieldDefaultWhat it changes
actionrequired"buy", "sell" or "close". Anything else is reported as an unrecognised decision.
qty1Contracts to open. Floored, and never below 1.
stopTicksnoneDistance in ticks below (long) or above (short) the fill price. Omitted means the position opens with no stop attached.
targetTicksnoneDistance in ticks for the profit-side exit. Omitted means no target.
returning nullA valid answer: do nothing on this bar.

How to use it

  • Write and save the strategy on the Scripting page first — the panel says "No strategy yet" when none exists.
  • Open Replay, show the trading dock, then choose the script in the Auto strategy selector.
  • Watch the decision counter rather than the equity line: it tells you the script is being called at all.
  • Switching scripts clears the carried state and the anti-replay guard, so the new script starts from a blank slate.

Limits and pitfalls

  • Entries pass the same guards as the manual buttons: a breached drawdown, a hit daily loss limit or an exceeded contract cap refuses the entry and the reason is shown.
  • Without a live price for the symbol the entry is held with "waiting for a live price" — no fill is invented.
  • Decisions are taken on closed bars only, so a strategy cannot react inside a forming bar; this is what keeps the live run and the backtest comparable.
  • The simulated account is local to this machine. Results there are not a forecast of anything traded elsewhere.

This page in other languages

Frequently asked questions

Can an auto strategy send an order to my broker?
No. The mount only calls the simulated account store, and the script itself runs in a worker with no platform API. The platform routes no orders to a broker at all.
Why does my strategy do nothing on the last bar?
The forming bar is deliberately excluded. The script is called only when a bar has closed, so the newest decision always refers to the bar before the one being built.
How many bars does the script see?
Up to 600 closed bars, newest first, converted to the frozen bar shape used by every script (time, OHLC, volume, delta, trade count and the footprint levels).

Keep reading