Live simulations
Create a live simulation on the Live Mode page, watch it trade the market as it moves, stop it, and read the run it leaves behind.
You have an algorithm that looks good on past prices and want to see what it does on prices it has never seen. A live simulation runs it on the market as it moves, on a simulated account, with no money at risk. This page takes you from creating one to reading its recorded run. For what the mode is and when to use it, see Operation modes.
Prerequisites
- You are signed in and this computer is registered. See Sign-in and plans.
- The computer stays on and connected for as long as the run should last. A live simulation runs on your computer, not on a server.
- Your plan allows another live run. The number of live runs that may be up at once depends on your plan. See Plans and quotas.
No exchange account and no API key are needed. Live prices are public data.
Creation
Open Live Mode in the sidebar and start a new live simulation. The same wizard that creates a backtest opens, titled New live simulation, with the steps Details, Balances, Data, Algorithms and Review.
In Details, name the simulation, choose its type and choose the quote asset its results are measured in. Live simulation runs one account. Live comparison gives each algorithm its own account so you can rank them. The quote asset cannot be changed later. See Primary quote asset.
In Balances, give the account its starting balance, exactly as for a backtest. The fees you set in Details are the fees the simulated account charges.
In Data, add the instruments. A live data source has a Provider and an interval, and no date range: it starts now. The instrument list is narrowed to what the chosen provider streams. Every data source of one simulation shares one interval.
In Algorithms, add one or more algorithms and set their parameters. You can skip Data and Algorithms and add them later on the simulation's own page.
Check the Review step and create the simulation. It opens under Live Mode.
You can also start from a backtest you already have. Select it on the Simulations page and choose Move to Live: Neurotrader creates a live simulation with the same instruments, algorithms and account.
Start
Open the simulation and choose Go live. The page turns from the setup into the live view, and the setup is locked until the run ends.
The algorithm acts each time a candle closes. With 1m candles that is once
a minute, with 1h candles once an hour. A candle that is still forming is
never shown to the algorithm.
Warm-up from recent candles
An indicator needs a full window of candles before it has a value. A 200-period average on hourly candles would otherwise need more than eight days before the algorithm could act.
So before the first live candle, Neurotrader reads the most recent closed candles from the provider and feeds them to the algorithm's indicators. It reads at least 128 candles, and more when an indicator needs a longer window. Three things follow:
- The indicators have values from the first step.
- The candle chart opens already filled with those candles, with the indicator values on them.
- The simulated account never trades on them. The run's orders, its net worth and its step count all begin at the first live candle.
The Right now panel reports the result for each algorithm in its
Warm-up row: warm, with the number of candles fed, or cold, with the
reason. An algorithm is cold when the provider did not have enough history
for the instrument, when the read failed, or when the algorithm comes from a
plugin, whose indicators live inside the plugin and cannot be fed from
outside. A cold algorithm still runs. Its indicators have no value until
enough live candles have closed.
Live view
While the run is up, the page is the live view. Everything on it describes the run so far and updates with every step.
Header. Next to the name and status, the heartbeat tells you the run is
alive: how long ago the last step arrived, how long until the next candle
closes, and how long the run has been up. If two steps pass in silence it
turns amber and reads no step for with the time. A quiet market and a dead
connection look the same on a chart, so check the heartbeat first.
Setup. One locked line states the setup the run is using. You can unfold it to read the data, the algorithms and the account. Nothing in it can be changed while the run is up.
Figures. A row of present-tense numbers:
| Figure | Meaning |
|---|---|
| Net worth | The account's value, in the quote asset |
| Since start | The change in net worth since the run started, in percent |
| Free · in orders | What is free to spend, and what is held by open orders |
| Open orders | The number of orders still working |
| Last price | The latest close of the instrument shown |
A simulation with margin terms also shows Margin level and Liabilities. In a live comparison the figures cover all accounts together.
Charts. The net worth chart and the candle chart share one time window, and the window follows the latest candle. The candle chart marks the run's orders and draws a dotted line at the price of each order that is still resting. If you pan back into the past, the window stays where you put it and Return to live appears. With several instruments, pick which one the candle chart shows.
Conditions. What the run is up against, newest first: the data feed dropping and coming back, a gap in the candles, a step that arrived with no candle. Each line has a time and a sentence. The header counts the conditions that are still standing. An empty list means nothing has been reported.
Activity. The run's orders, newest first. Each order appears when it is submitted and again when it ends: filled, cancelled, rejected or expired. Select a line to select that order on the chart. Steps where nothing happened leave no line.
Right now. For each algorithm, the latest value of every indicator, the warm-up result, and the orders resting on the book.
Stop
A live run has no end date. It runs until you stop it, and it cannot be paused: a paused run would come back to a market that had moved on.
Choose Stop in the header. The dialog Stop this live run? lists the orders that are working right now.
Choose what happens to them. Nothing is preselected.
- Close cancels every working order and sells back what the run's own fills bought, at the last close. The starting balance is left as it was.
- Leave ends the run and touches nothing.
Confirm with Stop and close or Stop and leave orders.
In a live simulation both choices are free, because the orders are simulated. The question is asked anyway so that stopping works the same way here as it does with a venue account, where the choice matters. See Demo runs.
To stop everything at once, use Stop all live runs on the Live Mode page. It asks the same question once and applies the answer to every live run that is up.
If you close the app, the run continues, because the engine runs it. If the engine itself shuts down, it stops its live runs with Leave and records them.
Recorded run
When the run ends, the page returns to the setup with the list of runs beside it, and the run you stopped is at the top. It is recorded like a backtest run: return, maximum drawdown, orders, the net worth curve, the candles and the journal. A stopped run's results describe exactly the part that ran. The run's record also states what the stop did: how many orders were cancelled or left standing.
Neurotrader keeps every candle the run received as part of the run, so the candle chart of a recorded live run shows what the algorithm saw, not what a later download would show.
From here you work as with any simulation: open the run for its charts and journal, change the setup, and go live again. See Run results and Charts.
Related
- Operation modes: the four modes and what each is for
- Simulation creation in the app: the wizard, step by step
- Demo runs: the next step, on the venue's Demo account
- Market data providers: where live candles come from
- Realtime updates: the same live view through the API
Market data downloads
The Repository page: the market data on this computer, the data available to download, starting and following a download, and your plan's data quota.
Venue account connection
Store a Binance credential in Neurotrader: generate a key pair, register the public key at Binance, and complete the credential with the API key.