Simulation
Set the instrument and period, review calculation settings and control a simulation.
Launch Settings
Simulation → Launch Settings. Open the window with XTester: Show Simulation.
- Select Asset Class, Source and Market.
- Choose the Symbol and then the Timeframe.
- If candles are missing, open Data → Download Data and prepare the required history.
- Go to Simulation Settings to review the period and starting balances.
- Open Launch Settings.
- Choose the asset class, source and market.
- A no-candles marker means history is needed first.
- Choose the timeframe.
Choose the instrument and launch profile here. Symbols come from downloaded instruments for the selected source and market. A no-candles marker means history must be downloaded before starting.
Simulation Settings
Simulation → Simulation Settings.
- Review Start (UTC) and End (UTC).
- Check the starting-capital summary; open Balances… if needed.
- Choose the auto-pause conditions you need.
- Review the data settings and use Apply Settings to apply changes.
- Open Simulation Settings.
- Set the start and end of the period in UTC.
- This example starts from the project’s balance table.
- Choose the events that should pause the simulation.
In Period and Account, set the start and end of the run in UTC. The Start summary shows the source of starting capital. Balances… opens the separate window for starting balances and the current account.
In Auto-Pause, choose which events pause the run. Data-quality and execution-model settings control which data and assumptions the calculation uses.
Simulation Profile
Command Palette → XTester: Simulation Profile: Fees, Slippage, Leverage.
- Select the exchange and review the effective-values block.
- Choose the market and enable custom costs if standard rates are unsuitable.
- Review maker/taker fees, the slippage mode and any other required fields.
- Use the appropriate Apply button, then recheck the effective values at the top.
Select the exchange on the left. The top block shows the effective values used by the calculation engine. Use it to distinguish current calculation costs from form values that have not been applied.
- Select the exchange in the left-hand list.
- These are the effective values used by the calculation.
In Market: Fees, Slippage and Funding, choose the market. Enable Own execution costs for this market to enter your own rates. Default values are marked beside the fields. With custom costs disabled, the market uses standard exchange costs.
- Choose the selected exchange’s market.
- Enable own execution costs to edit these fields.
- Check each fee and its displayed units.
- Set the slippage mode and its size separately.
These parameters apply to the current engine process; the window explains that they are not written to user settings on disk. Cost changes are refused during a running or paused run.
Start, monitor, and cancel
Compile the current source before running. Start the backtest and watch progress in the panel and XTester output channel. Avoid changing the active project while an engine operation is using it.
Cancellation is a request to stop the running operation. Wait for a completion or cancellation result before assuming the engine is idle. Open the results after a completed run.
What a backtest can tell you
A backtest evaluates code against the history and execution assumptions available to the engine. Check data coverage, fees, order size, and the engine’s supported market model when assessing a run.
Historical performance is not a forecast. Studio help does not make claims about strategy profitability or promise live-trading features that are not present in the interface.
Autopause
A run can stop on its own: on a strategy error, on an order placed, filled and completed, on a position opened and closed, on a stop triggered and on a liquidation. A separate switch governs stopping at chart breakpoints.
In an ordinary run these conditions are on. A fully automatic run that has to compute its whole period without stopping turns them off — otherwise it stops at the very first order.
Statistics and Trades
While the session moves the statistics are re-read once a second; while it stands, and after the end of the period, once every five seconds. The numbers carry an engine revision: equal revisions mean equal numbers.
The numbers come either from the current session or from the report a stopped session left behind. Live series are thinned to five hundred points, which is enough for a mini chart and light enough to read once a second.
Account
The Balance panel shows the balances, positions and orders of the session. A position is closed fully or in part and an order is cancelled with commands of the panel; Edit Balance… and Delete Balance open the Balances window at that row.
Exchange balances are loaded by a separate command and shown next to the simulated ones. That is a reading, not a transfer: the simulation keeps computing with its own values.
Balances
The Balances window opens from the button in the title of the Balance panel, from the Balances row of its tree, from the Balances… buttons of the Simulation window and from the command Balances: Starting and Current Account.
The Starting tab is the table every simulation and every backtest of the project starts with: Save writes it into simulation.startingBalances of xtester.strategy.json, so it survives a restart and travels with the robot; the current session keeps its old start.
The Current Account tab edits the account of the session: Apply to the Account changes it at once, the change lasts until Stop, and the next start begins from the starting balances again; Copy to Starting moves this account into the table, which is then left to save. Both tabs are split by the markets of the exchange; a row holds Asset, Free, Locked and Total (free plus locked), and a new asset is picked from the asset list of the exchange.
- Choose Starting: this table funds a new run.
- Edit the free and locked amounts for the selected asset.
- Save stores the starting table; the dot on its tab marks an unsaved edit.
One rule decides what a simulation, a backtest, a robot and a preflight check start with. The table funds the start when the session runs on the exchange of the project (or the project names none) and the table has rows of the instrument’s market.
Otherwise the start uses a deposit: the one set in the Simulation window for the session or for the backtest, else the project deposit depositUsdt, else 10,000 in the quote asset of the instrument. A deposit set for the session wins over the table and lasts until Stop; saving the table or the project deposit clears it. A fresh start first clears every virtual account and only then funds it from the table or the deposit.
On the Simulation Settings and Background Backtest tabs the summary that begins with Start: says what the start uses, and the deposit field is hidden where the table funds the market. Remove Table — Start from the Deposit returns the start to the deposit; an empty table starts from the deposit too, so to start with nothing, keep a row with 0.
Locked in the starting table is the part of the asset the strategy cannot spend: no order holds it, yet it is not free either; it counts in equity. Usually it is 0. In the current account Locked is held by open orders and by the margin of positions, so while a market has orders or positions only Free changes there, and an asset with a locked part cannot be removed.
The current account is edited only on an ordinary pause of the simulation: not while it moves, not at a code breakpoint, not during the warm-up and not after the end of the period. Rows of 0/0 are shown on both tabs — a spot order needs a row of its base coin, even with zero; the Needed for line lists the assets the instrument needs.
- Current Account belongs to the session, rather than the saved starting table.
- There is no session yet, so the account is empty and read-only. After starting, edit it on an ordinary pause.
Initial equity in the statistics is the value at the start of the assets of the instruments the strategy works with: base and quote on spot, collateral on futures. Rows of other assets are not part of it; when the strategy takes up the instrument of such an asset during a simulation, the asset’s value enters equity from that moment and shows as profit, so keep the table to the assets of the strategy’s instruments.
A coin in the spot base moves equity with its price even without trades. The statistics count an edit of the current account as a result: a top-up as profit, a withdrawal as loss; the edit is not recorded as a trade.
Background Backtest
Background Backtest runs a calculation without the simulation chart. Review the instrument, period and starting funds before starting. A completed result opens separately.
Strategy Parameters
Simulation → Strategy Parameters. These belong to the compiled strategy, separately from exchange, period or execution-profile fields.
- Select the intended project and compile.
- Open Strategy Parameters and refresh.
- Enter values within declared constraints.
- Start a new calculation to test them.
- Compare the new run’s conditions and log.
- Fields declared in the strategy.
Compile the selected strategy and refresh first. Names, types, defaults and restrictions come from its declarations. A strategy with no declared parameters does not require invented form entries.
An entered value overrides the default for this project. Reset removes that override. Missing and explicitly zero values can mean different things in the code.
Changes apply on a new Start. Continue retains parameters of the paused session; editing a field does not establish that the current calculation uses it.
After source changes, recompile and inspect the list: a parameter can disappear or change type/range. Overrides belong to their project folder and must not silently drive another strategy with a similarly named parameter.
Related commands
Command Palette reference
Find these actions by name in the Command Palette; availability depends on the current project and operation state.
xtester.accountCancelOrderxtester.accountClosePositionxtester.accountDeleteBalancextester.accountEditBalancextester.accountLoadExchangeBalancesxtester.accountOpenBalancesxtester.accountReducePositionxtester.accountRefreshxtester.accountShowOrderHistoryxtester.cancelBacktestxtester.paperScenarioxtester.runBacktestxtester.runBacktestQuickxtester.showSimulationxtester.showSimulationBalancesxtester.showSimulationProfilextester.simulationPausextester.simulationStartxtester.simulationStepxtester.simulationStepManyxtester.simulationStopxtester.strategy.runBacktestxtester.strategy.showSimulation