Discussing the MQL5 styler
Guano because it's not customizable.
I suggest either adding customisation, or formatting in a really common style.
Alternatively, make it possible to choose between 2-3 styles.
+
Actually, the solution is trivial and already implemented by many IDEs.
For each syntactic element ( { ( for function <= if ......) define rules: how many spaces to insert before it and after it and whether a line break is needed before or after it.
Custom settings should be saved to a file and automatically loaded (in priority) when the editor starts.

- www.mql5.com
Gentlemen, who is the code being written for?
I'm pretty sure it's for other programmers. It is very unpleasant for them to read other people's unformatted code.
It is to solve this very problem that we created the built-in styler function. If you want other people (not you, but other people) to be willing to look through your code, you'd better make it as simple and unambiguous as possible. And the key word here is "people", not "you".
Unified styling is important for the MQL5.community, because we collect a huge database of sources in the Code Base. This means that these sources will be read by a huge number of third-party developers and users.
To avoid creating an incomprehensible pile of code, all of the published scripts will be automatically
- cleaned by a styler
- check for correctness
generate standard screenshots for indicators
The logic is that the code is align ed to the nesting level. There is no disagreement here, as we can see.
But opening and closing parentheses are not code, they are design elements, so they slightly exceed the code by one character.
This surprised me. I always thought that a mistake in setting this so called "design element" could drastically change the code. But it turns out that it is not a code element at all. Here is an example:
if (условие) function1(); function2(); и ____________________________________ if (условие) {function1(); function2();}
The compiler said: "it's OK!". But the program will not work. Where is the error? In the layout? Or in the code?
Don't cling to words, please.
Imposing strict (even bordering on personal rights) design rules can eradicate killer code of the kind
if (условие) function1(); function2();
In fact, one could argue that weakness on this issue leads the development team into chaos.
It is to reduce this chaos that we have implemented a hard-nosed, unconfigurable styler.
A couple of thousands of scripts in the MQL4 Code Base have passed through the hands of our editors, who would have expressed much harsher views on the styles used. We do not want to go through such a process again.
100% right.
There has to be a SINGLE style. But! Everyone should and MAY have their own style.
Many people are accustomed to other common styles like VC++ (and I support ForexTools for example, I use it myself).
Why strain the already tortured brains of programmers... It's easier to make this style Customizable. You probably know how it feels when you are looking at a different style of code and you're tempted to change it to your own, native, comfortable style, which you³'ve been using for 15 years...
I think it's not so hard instead of moving brackets { } to the text, and then 1 space away from it - do nothing with them. Keep it level with its parent for, if, ...

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Discussing the MQL5 styler. Started here
I have to look at different code. This includes badly written code.
Good formatting considerably eases code reading.
Therefore, imho, the thing will remain unclaimed by the majority of normal coders due to specific formatting and lack of options.
I propose to either add customization or format in a really common style.
As an option -- make it possible to choose one of 2-3 styles.