Then we edit the code how it is shown in the screenshot (2):
We write namespace ATAS.Indicators.Technical because we will create our own algorithm in the space of other technical ATAS indicators.
Then we add using ATAS.Indicators… You will always use this reference when creating algorithms for ATAS (in the next but one paragraph).
Then we edit public class Example1_1: Indicator… Example1_1 in this line means that we make the first example from the first lesson (you can write any other name, which will be then displayed in the ATAS indicator list).
As regards the colon and the word Indicator, they are quite important. This is how we state that the Indicator class (it is in the ATAS.Indicators.dll) is a parent class and our Example 1_1 class inherits everything, which is available in the parent class. It means that we get access to all functions, which are allowed to be inherited by the Indicator class inheritors – which include operations with prices, clusters, other indicator values, etc.
Then we write protected override void OnCalculate (int bar, decimal value) and two curly braces. This code section is called the OnCalculate method…
In simple words, a method is a set of commands to the computer for execution. The OnCalculate method is declared as compulsory inside the parent. When you add your indicator to the chart, the platform will execute commands, which you write inside curly braces. If you do not have the OnCalculate method, Visual Studio will not allow you to build the code into a dll file, since it is compulsory to have it. Otherwise, ATAS will not understand what it has to execute.
If you did everything right, there will be No issues found (3) at the bottom. If errors are shown, try to understand what went wrong. What can go wrong:
- C # is case sensitive. It means that uppercase and lowercase letters in the code are interpreted differently.
- Curly braces, semicolons, quotation marks and other symbols – all of them are significant. In case you missed or lost something, Visual Studio will help you by giving suggestions.
Now, when you have the error-free code, let’s build it. To do it, select Build Lesson1 in the Build menu item (or press CTRL + B) and a message that the code was successfully built into a file should appear in the Output window.