Table of Contents

Using C#

Creating strategies from code is for users who prefer working with C# code. Such strategies are not limited in capabilities unlike diagrams, and any algorithm can be described.

The process of creating a strategy takes place directly in Designer or a C# development environment (the most popular of which are Visual Studio and JetBrains Rider), using a library for professional development of trading robots in C# and API.

You can add a new strategy by pressing the Add Designer Panel Circuits 01 button on the Common tab and choose Strategy. Or, by right-clicking on the Strategies folder in the Scheme panel, and pressing the Add Designer Panel Circuits 01 button in the dropdown menu:

Designer The creation of a strategy 00

After pressing the Add Designer Panel Circuits 01 button, a window will appear with a choice of content type to create the strategy on:

Designer_Creation_of_element_containing_source_code_00

To create a strategy from C# code, you need to select the second tab. You can also choose a template that will be used as the initial code.

After pressing OK, a new strategy will appear in the Strategies folder of the Scheme panel, similarly to when creating a strategy from diagrams. And similar actions for deleting or renaming the strategy.

But instead of a diagram, C# code editor will be displayed:

Designer_Creation_of_element_containing_source_code_01

The code editor tab consists of Source Code and Error List panels. The Source Code panel contains the C# code editor itself. At the top, there is a toolbar where highlighting such things as Current Line, Line Number, etc., can be turned on or off. To increase the font size, you can use the CTRL+MouseWheel combination.

The Error List panel is a table with a list of errors in the code, double-clicking on a line will automatically move the cursor in the Source Code panel to the error location.

When editing the code, an icon Designer The creation of the cube containing the source code 03 will appear in the bottom right corner of the Error List panel, indicating that change tracking has begun. The code compiles at the moment when the code stops changing.

Running the strategy on backtest, on live, and other operations are similar to the strategy from diagrams.