Developer guide
The ways to run your own code in Neurotrader: a Rust plugin, a remote program in any language, and the HTTP API.
You write code, and you want Neurotrader to run a strategy of your own, or you want to drive the engine from a script. There are three ways in, and they can be combined.
| Way in | Language | Code location | Suits |
|---|---|---|---|
| Plugin | Rust | Inside the engine | Backtests over long histories, and every operation mode |
| Remote algorithm | Any | Your own program, called over HTTP or WebSocket | An existing code base, a model in Python, quick experiments |
| HTTP API | Any | Your own client | Creating simulations, starting runs and reading results without the app |
A plugin and a remote algorithm receive the same information on every step as a built-in algorithm does: the candles that closed, the account's balances and the orders still open. Both return the same thing, a list of orders to place or cancel. Neither one simulates a fill or computes a fee. The engine does that, the same way for every algorithm.
If you would rather describe a strategy in words and have the plugin written for you, see Algorithm Assistant. What it produces is an ordinary plugin project, so everything in this section applies to its output too.
Plugins
Plugin authoring
The anatomy of a plugin: the trait you implement, parameters, indicators, orders, state, tests and builds.
Plugin SDK
What the SDK crate holds, what it leaves out, and where it lives.
Determinism rules
What a plugin must not do if the same run is to give the same result twice.
First plugin
A walkthrough from the skeleton project to a plugin running in a simulation.
Plugin upload
The Algorithms page: upload, link, build, load, unload and remove.
Remote algorithms
HTTP API
First simulation with the API
Sign in, obtain a token and make a first request.
API reference
Every operation of the engine's HTTP API.
Related
- Algorithms: what an algorithm is and how it is run
- Built-in algorithms: the algorithms that come with Neurotrader
- Algorithm confirmation: the check an algorithm of your own passes before it trades real funds
Glossary
The terms used in the Neurotrader app, the API and this documentation, in alphabetical order, with the API's word where it differs from the app's.
Plugin authoring
The anatomy of a Neurotrader algorithm plugin: the trait you implement, parameters, indicators, orders, state, tests, builds and compatibility with the engine.