Skip to Content
NeurotraderDocs
How-to guides

Algorithm Assistant use

The Assistant pages in the app, step by step: toolchain setup, a new algorithm from a description, a change to an existing one, following the writing, and a first simulation of the result.

You want an algorithm written from a description, and you want to see it trade in a simulation. This guide walks through the Assistant pages in the app. For what the Assistant is, what it sends from your computer and what it cannot promise, read Algorithm Assistant first.

Assistant page

Open Assistant in the sidebar. The first time, the page says Starting the Build Agent for a moment: that is the program that writes and builds on your computer.

The toolbar has three parts:

  • New algorithm starts a new one.
  • Credit shows how much of this period's Assistant credit is used, as a percentage, and the day it resets. The bar turns amber at 80% and red when the credit is used up.
  • The toolchain button at the end shows the state of your build tools: Toolchain not checked, Toolchain ready, Toolchain needs attention or Toolchain being set up.

Below the toolbar is the list of your projects. A project is a folder you chose, and the list shows its name, its path and its state:

StateMeaning
EmptyThe folder is a project, and no algorithm has been written into it
Being writtenThe Assistant is writing or changing it right now
Not builtThe code is written, and there is no built library
BuildingA build is running
BuiltThere is a built library, ready to add to Neurotrader
Folder missingThe folder is gone or no longer holds this project
Screenshot
The Assistant page with three projects in the list on the left, one Built, one Not built and one Being written, the selected project's card on the right with its path and the buttons Change it, Open in editor, Open folder, Build, Add to Neurotrader and Remove from list, the Credit bar at 34% used and the Toolchain ready button in the toolbar, and the amber caution note at the foot

With no project yet, the page shows Describe an algorithm in your own words and a New algorithm button.

Toolchain setup

Writing an algorithm builds it on your computer, which needs Rust and the C++ build tools. Do this once.

Toolchain check

  1. Choose the toolchain button at the end of the toolbar. A panel titled Toolchain opens.
  2. Choose Check now. The check builds an empty algorithm, which can take minutes the first time.

The panel lists C++ build tools, cargo and rustc, each Present or Missing, and the Trial build of an empty algorithm as Passed, Failed or Not tried.

If everything is present and the trial build passed, the button reads Toolchain ready and you can skip the rest of this section.

Setup plan

  1. In the Toolchain panel, choose Set up. The Toolchain setup dialog opens and looks at what is installed.
  2. Read what it will install. Each component is listed with what it is for, the size of its download, the space it takes and about how long it takes.
Screenshot
The Toolchain setup dialog before anything starts, listing the C++ Build Tools and Rust with their download sizes, disk space and durations, the note that Windows asks for permission once, the sentence about accepting Microsoft's licence terms with its link, and the Install button beside the Setup guide link

Two things on this screen need your attention:

  • Windows asks for permission once. The C++ Build Tools are installed for the whole computer. On an account without administrator rights, Windows asks for an administrator's password at that point.
  • Licence terms. The installation shows no licence screen of its own. By choosing Install you accept the terms linked in the dialog.

If the dialog says Neurotrader cannot install a tool on this computer, or you prefer to install the tools yourself, follow the Setup guide link.

Installation

  1. Choose Install.
  2. Approve the Windows permission prompt when it appears.

The dialog shows each component as it is downloaded and installed, with a progress bar where the progress is known. The C++ Build Tools take the longest. The last step is a trial build of an empty algorithm.

You can close the dialog. The setup goes on, and choosing Show setup in the Toolchain panel brings it back. Nothing else can be built or written until it has finished.

Stop takes effect between steps. An installer that is already running finishes first.

Setup result

The dialog saysMeaningAction
The toolchain is readyEverything is installed and a trial build passedChoose Close and start writing
Installed, and a trial build still failsThe tools are there, but an algorithm does not buildRead the build output shown in the dialog. The setup guide covers common causes.
Nothing was installedThe Windows permission prompt was not acceptedStart the setup again, or follow the setup guide
The setup was stoppedYou stopped it. What was installed stays installed.Start the setup again for the rest

If Windows asks for a restart to finish the installation, restart before you continue. Programs that were already open, such as a terminal or Visual Studio Code, find the new tools once you restart them.

New algorithm

Description

  1. Choose New algorithm. The page Describe your algorithm opens on the first of three steps: Describe, Confirm, Write.
  2. In Project folder, enter or browse to an empty or new folder. The algorithm is written there and named after the folder.
  3. In Description, say when to buy or sell, and how much. Use plain words, in any language. To start from an example, choose one under Try one.
  4. Choose Continue.
Screenshot
The Describe step of a new algorithm with the stepper showing Describe, Confirm and Write, the Project folder field filled with a path ending in dip-buyer, the Description box holding the sentence about buying gold when bitcoin drops below its 90-day average, the three Try one examples, and the Continue button beside the line Each attempt uses a little of the credit

A good description states a condition, an action and an amount:

Buy when RSI goes under 30 and sell when it is over 70.

Nothing is created yet. The folder becomes a project only when you ask for the algorithm to be written.

If the Assistant cannot build from your text, a note appears under the box with the reason, for example This does not describe a rule yet, and a sentence saying what is missing. Rewrite the description and choose Continue again. Each attempt uses a little of the credit, including one that is refused.

Confirmation

The page Is this what you meant? shows what the Assistant understood.

Screenshot
The Confirm step with the readback card on the left showing the algorithm's name, the readback sentences, a Rules list of When and Then pairs, Amount, Instruments marked Traded and Read never traded, Tunable parameters and Indicators, and on the right the Open questions as groups of radio buttons, with Back and Write the algorithm at the foot

Read the left side carefully. The code is written from this text, not from your original words.

SectionContent
The readbackOne or two sentences stating what the algorithm will do
RulesEach rule as When and Then
AmountHow much it trades
InstrumentsEach instrument in your own words, marked Traded or Read, never traded. You choose the actual instruments when you add the algorithm to a simulation.
Tunable parametersEach parameter with its default
IndicatorsThe indicators it uses
Unsupported partsAnything in your description that cannot be built, and why

On the right, Open questions lists what your description left open, each with a suggested answer already selected.

  1. Answer every question. Keep the suggested answer or choose another.
  2. If you changed an answer, choose Update. The readback is written again with your answers. Read it again. An update uses a little of the credit.
  3. If something is not what you meant, choose Back and say it differently.
  4. When the readback is right, choose Write the algorithm.

Writing

The page Writing the algorithm shows the work as it happens, one line per action:

LineMeaning
Read, Wrote, Edited and a file nameThe Assistant read, created or changed that file in your project
Build, TestsA build or a test run, then passed or failed with the time it took
Working on the next stepThe model is thinking or writing. This can take a minute.
Screenshot
The Write step in progress: a list of lines such as Wrote src/lib.rs, Edited src/algorithm.rs, Build passed in 41 s and Tests running, the line Working on the next step with a spinner, the note that the work continues if you leave the page, and the buttons Leave it running and Stop

A failed build or test in the middle is normal. The Assistant reads the output and repairs the code. Writing usually takes about two minutes.

The page lists files and results, not the code. The files are written to your project folder as it goes.

  • Leave it running returns to the project list. The work continues and a notification says when it ends.
  • Stop ends the writing. The files stay as they were at that moment and may not build.

Result

When it ends well, the page says The algorithm is written and shows:

  • Summary: what was written, in the Assistant's words.
  • Checks: three marked Passed (you confirmed what it should do, it builds, its own tests pass) and one marked Not yet: that it trades as you intend. A simulation shows that.

From here you can choose Open in editor (Visual Studio Code) or Open folder to read the code, Add to Neurotrader to load it into the engine, or Done to return to the list.

If it ended early, the page says why under Ended:

TitleMeaning
StoppedYou stopped it
It did not get thereThe algorithm was not finished within the allowed number of steps. Try a simpler description, or describe it in smaller parts.
The credit ran outThis period's credit was used up before it finished
Not in your planYour plan does not include the Assistant
The connection was lostThe connection to the Assistant's service dropped and could not be reopened
Sign in againYour session was not accepted

After an early end the files are as they were at that moment. Choose Open folder to look at them, or start again.

Simulation of the result

A written algorithm has been built and tested. It has not been shown to trade the way you intend. A simulation shows that.

  1. On the result page, or on the project's card in the list, choose Add to Neurotrader. If the project has no built library yet, it is built first. A first build compiles everything the algorithm depends on and can take several minutes.
  2. A message says Added to Neurotrader. Choose See it in Algorithms. The algorithm is under Your algorithms with the state Available.
  3. Create a simulation and add the algorithm to it. See Simulation creation in the app.
  4. In the Data step, add an instrument for each role the readback named. An algorithm that reads one instrument and trades another needs both.
  5. Run the simulation and open the run.

If the simulation is refused when you start it, read the message. A written algorithm refuses a set of instruments that does not fill its roles, and says which is missing.

Then check the run against the readback:

  • Look at every order on the candle chart. Does each one sit where the rule says it should?
  • Does it buy once or repeatedly, as you answered in the open questions?
  • Is the amount what you described?

If the orders do not match, the algorithm is wrong, whatever the return says. Change it, as described next, or edit the code yourself.

AI-written code

The Assistant can misread a description and can write code that departs from the readback. Read the code, run it in a simulation and look at every order it places. Do not run it in Real Trade until you have: real money is at risk there. What it trades is your responsibility, and none of this is investment advice.

Change to an existing algorithm

  1. On the Assistant page, select the project.

  2. Choose Change it. The page What should change? opens, with the project's path above the box.

  3. In Change, describe only the change, for example:

    Also sell everything if the price closes 8% below the price I bought at.

  4. Choose Continue.

  5. On Is this what you meant?, read the whole new readback, not only the changed part. Answer any open questions and choose Make the change.

  6. Follow the work on Making the change. It ends with The change is made.

  7. Choose Add to Neurotrader to load the new build in place of the old one.

The Assistant reads the project's files as they are, including your own edits, so you can mix its changes with yours.

A change is refused while a run is using the algorithm's plugin, at the moment you add it to Neurotrader. Stop the run, or wait for it to finish, and choose Add to Neurotrader again.

Change it is offered once an algorithm has been written into the project.

Project actions

Select a project in the list to use the buttons on its card:

ButtonEffect
Change itStarts a change to the algorithm
Open in editorOpens the folder in Visual Studio Code
Open folderOpens the folder in the file manager
BuildBuilds the project as it is on disk, including your own edits. If it fails, open the project in your editor to see the compiler's output.
Add to NeurotraderUploads the built library to the engine, building first if needed
Remove from listTakes the project off this list. No file is deleted.

To bring back a project you removed or moved, choose New algorithm and enter its folder. A folder that already holds a project is opened, not overwritten.

Messages

MessageMeaning and remedy
The assistant cannot start: The Build Agent is not installed on this computerThe Build Agent is installed with Neurotrader's engine. Install or repair Neurotrader on this computer.
The assistant did not answerThe Build Agent could not be reached. Choose Try again.
Your plan does not include the assistantSee Plans and quotas
This period's assistant credit is used upWait for the reset day shown beside the Credit bar
The credit could not be checked just now, so nothing was startedTry again shortly.
That folder is not empty. Choose an empty oneA new project needs an empty or new folder
That folder does not hold a project the assistant madeChange it and Build on this page work on projects the Assistant created
This project is being written or builtWait for the work in progress to end
The toolchain is being set up right nowWait for the setup to finish
This readback is no longer valid. Describe the algorithm againStart from the description again and confirm the new readback
Visual Studio Code could not be started. Is code on the path?Install Visual Studio Code, or use Open folder
Neurotrader's engine did not answerCheck that the engine is running, then choose Add to Neurotrader again
The assistant's service could not be reachedCheck your internet connection and try again

On this page