Simulation creation in the app
The five steps of the New simulation dialog: Details, Balances, Data, Algorithms and Review, with what each step requires and what you can fill in later.
You want a new simulation: a saved setup of market data, algorithms and an account that you can run as often as you like. In the app you create one in the New simulation dialog, which walks through five steps. Two of them, Data and Algorithms, can be left empty and filled in later on the simulation's own page.
If you would rather create a simulation from a script, see Simulation creation with the API.
Prerequisites
Decide three things, because none of them can change once the simulation exists:
- The kind: Single account, Comparison or Instrument sweep. See Kinds of simulation.
- The quote asset: the currency every result is measured in. See Primary quote asset.
- Spot or margin: whether the account may borrow. See Margin and leverage.
Everything else (the name, the fees, the data sources, the algorithms and their parameters) can be changed afterwards.
Dialog
- Open the Simulations page from the sidebar.
- Select New Simulation in the toolbar, or press
Alt+N.
The New simulation dialog opens on its first step. The row of numbered steps at the top shows where you are. Next moves forward once the current step has what it needs, and the line beside the buttons says what is missing when it does not. Back returns to the previous step without losing anything, and you can also select any step you have already reached.
Cancel, the close button and Esc all leave the dialog and drop the draft.
Selecting outside the dialog does nothing, so a stray click cannot lose your
work.
Details
The Details step holds what the simulation is called, how it is arranged and what trading costs.
-
Enter a Name. It is required, and you can rename the simulation later.
-
Under Type, choose one of the three kinds:
Type What it creates Single account One portfolio. Every algorithm you add trades the same balance, and the run is their combined result. Comparison One portfolio per algorithm. Each starts from the same balances and is scored on its own. Instrument sweep One setup and one portfolio per instrument. The same algorithm and balances run on every instrument. -
Under Quote asset, pick the asset that net worth and every return are valued in. It is required.
-
Under Fees, set Maker fee (%) and Taker fee (%). Each is charged per trade as a percentage of its value, and each opens at 0.1. A fee must be between 0 and 100. See Fees.
-
Leave Margin off for a spot account, which trades only what it holds. To let the account borrow, switch it on and review the fields under it: Leverage levels offered, Margin call at, Call clears above, Liquidation at, Interest (% per hour) and Liquidation fee (%). They open on sensible defaults: leverage levels of 2 and 3, a call at 1.3 that clears above 1.5, and a liquidation at 1.1.
-
Select Next.
Three permanent choices
The type, the quote asset and the margin terms are fixed when the simulation is created. Every run's results are measured under them, and changing one would make new runs impossible to compare with old ones. To try a different choice, create another simulation.
Balances
The Balances step holds the funds the account starts with. At least one balance is required.
- Under Asset, the picker already shows the quote asset you chose. Keep it, or pick another asset.
- Enter an Amount. It must be greater than zero and can have up to six decimals.
- Select Add, or press
Enterin the amount field. The balance appears in the table below. - Repeat for any other asset the account should hold at the start. Adding an asset that is already in the table tops it up.
- To drop a balance, select the remove button at the end of its row.
- Select Next.
Fund the quote asset. A run needs a balance in the asset its results are measured in.
In a comparison or an instrument sweep, every account starts with a copy of these balances.
Data
The Data step holds the market data the algorithms read. You can leave it empty and add data sources later, with one exception: an instrument sweep needs at least one instrument before it can be created.
- Select the add button (the plus icon) in the Data card's header. The Add data source dialog opens.
- Set the start date, the end date and the interval, or select one of the range presets such as Last year.
- Search for a pair by symbol or name and select it. You can select several.
- Select Add.
Every data source of a simulation shares one date range and one interval. The steps, the presets and the limits on the range are described in full in Data source setup.
In an instrument sweep, each data source is one instrument, and all of them must use the same interval.
Algorithms
The Algorithms step holds what trades the balances. You can leave it empty and add algorithms later.
- Select the add button (the plus icon) in the card's header.
- Pick an algorithm from the list on the left. Its label and parameters appear on the right.
- Change the parameters if you want to. Each opens on the algorithm's default.
- Select Select (for the first algorithm of a single account or a sweep) or Add.
What happens with more than one algorithm depends on the type:
- Single account: the algorithms trade the one account together. Each needs its own label. The card notes how many algorithms share the account.
- Comparison: each algorithm gets its own account. Use the sources button on an algorithm's row to choose which data sources it reads.
- Instrument sweep: the setup runs once on each instrument. There is nothing to link.
See Algorithm setup for labels, parameters, adding the same algorithm twice and groups.
Review
The Review step lists everything the simulation will be created with: the name, the type, the quote asset, the fees, the margin terms, the number of data sources and algorithms, and the Initial balances.
- Check the summary. To change something, select Back or the step's number at the top.
- Under After creating, choose where the app takes you next:
- Back to list returns to the Simulations page.
- Open it opens the new simulation's page.
- Create another clears the dialog for the next simulation.
- Select Create simulation.
The app confirms with "Simulation created". If the engine refuses the request, the dialog stays open with your draft and a message says why.
Required and optional parts
| Part | At creation | Later |
|---|---|---|
| Name | Required | Can be changed in the simulation's header |
| Type | Required | Fixed |
| Quote asset | Required | Fixed |
| Fees | Required, 0.1% each by default | Can be changed on the Account card |
| Margin | Off by default | Fixed |
| Balances | At least one | Shown on the Account card |
| Data sources | Optional (a sweep needs one instrument) | Add, change and remove on the Data card |
| Algorithms | Optional | Add, change and remove on the Algorithms card |
A simulation with no data sources or no algorithms is saved, but it cannot run until it has both.
Live simulations
The same dialog creates live simulations. Open it from the Live Mode page and the Type choices become Live simulation and Live comparison, and the Data step asks for a provider instead of a date range. See Live simulations.
Related
- Simulations: the three kinds and what each is for
- Data source setup
- Algorithm setup
- Run control: starting the simulation you created
- Simulation creation with the API
- First backtest: the whole path with one concrete example