Syntax

I hope you enjoyed the "Welcome" lesson in which I tried to answer the very basic questions: What is MQL4? Why use MQL4? And where can we write MQL4?
But the most important question has not yet been addressed: How do we write MQL4? All of the coming lessons are attempts to answer this question.
Now I want you to relax and empty your mind for the next few minutes.
We are talking today about the rules of SYNTAX for MQL4.
And as I told you before, if you are coming from C/C++ programming, then you already know a lot of MQL4 before I start my lessons because the syntax of the MQL4 language is very similar to the syntax for C/C++.



What does "SYNTAX" mean?

The syntax of a programming language is equal to the grammar applied in spoken languages.
So, when we study the syntax of a programming language, we study the rules of its grammar and writing, which consist of:

• Format
• Comments
• Identifiers
• Reserved words

let's slice the cake

1- Foramt:

When you write your MQL4 code, you can freely use any set of spaces, tabs and empty lines to separate your code and your lines of code to make them more readable and pleasing to the eye.
For example, all of these lines are valid in MQL4: