Algorithm setup
Add an algorithm to a simulation, set its label and parameters, add the same algorithm twice, change or remove it, and group algorithms onto one account.
You want to choose what trades in a simulation: which algorithms, with which parameters, reading which data. You do this on the Algorithms card of the simulation's page. The same card appears in the Algorithms step of the New simulation dialog.
For what an algorithm is and which ones come with Neurotrader, see Algorithms and Built-in algorithms.
Algorithms card
Open a simulation from the Simulations page. The card is titled Algorithm while it holds one and Algorithms once it holds several.
Each row shows the algorithm's label, the algorithm's own name beside it when the two differ, and a line saying which data sources it reads. At the end of the row are its controls: a configure button (the sliders icon) and, where the algorithm can choose its data, a sources button such as 2 sources.
The header holds the add button (the plus icon) and the remove button (the bin icon). With more than one row it also holds select-all and clear-selection buttons.
Algorithm addition
- Select the add button (the plus icon) in the card's header. On a single account with no algorithm, the dialog is titled Select algorithm. Otherwise it is titled Add algorithm.
- Find the algorithm. Type in the search box to match names and descriptions, or select one or more category chips above the list to narrow it.
- Select the algorithm. The right side of the dialog shows its Label and parameters. Selecting the same row again closes them.
- Set the Label and the parameters, as described below.
- Select Select or Add.
The dialog adds one algorithm at a time. To add two, open it twice.
Label
The Label names this algorithm in the simulation: on the card, in every run's results and on the charts. It opens on the algorithm's own name.
- For an algorithm on an account of its own, the label is optional. Left empty, the algorithm is shown under its own name.
- For an algorithm that shares an account with others, the label is required.
It must be different from the other labels on that account, and it cannot
contain
/,.or@.
Give a clear label whenever you add the same algorithm more than once, for example "SMA 9/21" and "SMA 20/50". Without one, the results tell the copies apart only by a short id.
Parameters
Each parameter opens on the algorithm's default. Depending on the parameter you get a number field with steppers, a slider, a text field, a tick box, a switch or a list to choose from. An algorithm with no parameters says so.
Values are checked when you select Add. If one is out of range or a required one is empty, the dialog stays open, marks the field and says "Some parameters need attention."
Several algorithms
What a second algorithm means depends on the simulation's type.
Single account
The algorithms trade the one account together. Each sees the whole balance. Within a step, the first to act takes what it takes, and a later one is refused what is no longer there. There are no shares to set: you cannot give each algorithm a fixed part of the balance, because a real account does not work that way either.
When you add the second algorithm, the app confirms that the two now trade the account together, and the card's footer counts them, for example "2 algorithms on one account, traded together". The run reports them as one result. See Algorithm groups.
Comparison
Each algorithm gets its own account with the same starting balances, and the run scores each on its own. Add as many as you want to compare. A new algorithm reads no data until you link it: see Data sources of an algorithm.
Instrument sweep
The card shows one setup, and it runs once on every instrument. Adding an algorithm adds it on every instrument, changing a parameter changes it on every instrument, and removing it removes it everywhere. A second algorithm makes the setup a pair that trades each instrument's portfolio together.
If a change reaches only some instruments, the card's footer says so in red and offers Repair. Select it to bring every instrument back to the same setup. A sweep does not run while its instruments disagree.
Same algorithm twice
The same algorithm can be added more than once, each time with its own parameters. This is how you compare settings.
- Add the algorithm with its first set of parameters and a label that says which set it is.
- Select the add button again.
- Select the same algorithm, change the parameters, and give it a different label.
- Select Add.
In a comparison the two copies run on separate accounts, and the results rank them side by side.
Data sources of an algorithm
The line under an algorithm's label says what it reads: "Reads BTCUSDT", "Reads every source" or "Reads nothing yet".
-
The one algorithm of a single account reads every data source. There is nothing to choose.
-
In a comparison, and for each algorithm sharing a single account, you choose:
- Select the sources button at the end of the algorithm's row. It shows how many sources the algorithm reads, for example 0 sources.
- Tick the data sources the algorithm should read. Untick one to stop reading it. Each change is saved as you make it.
-
In an instrument sweep, each copy reads its own instrument.
An algorithm that reads nothing has nothing to trade. Link every algorithm before you run a comparison.
Parameter change
- Select the configure button (the sliders icon) on the algorithm's row. A dialog opens, titled with the algorithm's label.
- Change the parameters.
- Select Save.
For an algorithm that shares an account with others, the same dialog also holds its Label, so you can rename it there.
The label of an algorithm on an account of its own is set when you add it. To give it a different label, remove it and add it again. The same goes for swapping one algorithm for another: an entry on the card is always the algorithm it was added as.
Past runs keep the parameters they ran with. After a change, the simulation's header shows "Changed since the latest run: algorithms" until you run again.
Algorithm removal
With one algorithm on the card, select the remove button (the bin icon).
With several:
- Select the rows to remove, or use the select-all button.
- Select the remove button.
On a single account, removing algorithms until one is left returns the account to that one algorithm on its own.
Groups in a comparison
In a comparison, you can put several algorithms onto one of the compared accounts. The group then competes as one entry against the other algorithms, which lets you compare a mix of strategies with a single strategy, or one mix with another.
- Select two or more rows on the card.
- Select the group button in the header (the layers icon, "Group the selected algorithms onto one account"). A dialog opens, titled with the number of algorithms, for example Group 2 algorithms.
- Enter a Name. It is how the group is named on the card and in every run's results.
- Check the label of each member. Labels must be unique within the group and
cannot contain
/,.or@. - Select Group.
The card now shows one group row, with a line such as "Group of 2 · reads BTCUSDT". Use the chevron at the start of the row to unfold it and see its members. Each member has its own configure button, its own sources button and a remove button that takes it out of the group.
To take a group apart, select the Ungroup button on the group's row. Each member goes back to an account of its own.
Grouping and ungrouping replace the entries on the card, so the header notes that the algorithms changed since the latest run.
Paused simulations
While a simulation is paused, the Algorithms card is locked. Resume or stop the run to edit it again. See Run control.
Related
- Algorithms
- Algorithm groups
- Built-in algorithms: every built-in algorithm and its parameters
- Data source setup
- Plugin upload: adding your own algorithms to the list
- Algorithm comparison
Data source setup
Add and remove data sources on a simulation's Data card, and change the date range and interval that every source of the simulation shares.
Run control
Start, pause, resume, stop and reset a simulation in the app, read its progress and status line, and know what each action keeps and what it discards.