The Strategy Editor allows the creation and execution of customized strategies, in order to optimize the user's analysis when making decisions.
To do so, using the tool requires basic knowledge of some programming concepts, as well as the Nelogica Trading System Language (NTSL).
Structure
Usually, a strategy has 3 distinct sections: the parameters declaration area, the variables and functions declaration area, and the code area.
The input parameters area encompasses the entire region between the reserved word input (parameter) and the reserved word var. The variables and functions area starts with the word var and extends until the word begin (start).
Parameters Declaration Area (input)
In the input parameters declaration area, we define all the external parameters that the strategy will use.
Constants and parameters are values that do not change while the code is running.
The difference between them is that the user can interact with the parameters outside of the Editor.
To define a parameter, we use: Parameter Name (Initialization Value)
Example: FastAverage(9)
This defines a parameter initialized with the value 9.
Variables and Functions Declaration Area (var)
In the variables declaration area, we define all the variables that will be used in the strategy.
Variables are used to store results generated by the code. Each variable must have a data type.
In this section, we also define the functions we want to use in the code. Functions should always be written after the variable declarations.
To declare a variable, we use: Variable Name : Type
Example: sResult : Float;
This creates a variable named sResult of the floating-point type.