Hello, I would like to suggest developers to standardize indents in MetaEditor when writing code, as it is done in VisualStudio. Because there is no standard indentation in functions and blocks. As a result, the code is less readable. Also when copying and pasting the code, it is inserted askew, some lines are left and some are right. Can you please fix it. And to be able to button normalize all the code on the indentation automatically, it is also implemented in VisualStudio
To make code readable, use styler:Styler - Work with Source Code - Program Development - MetaEditor

- www.metatrader5.com
P.s. How easy it is to make everything beautiful now, and I was struggling and added spaces, got used to automatically write beautifully at once, etc.
The code styler has one codestyle, a la K&R, which most programmers are steadily sick of. I have FormatMQL project in VS, make links to sources, which I'm going to use tightly and reformat into human MS Style.
The styler has one codestyle, a la K&R, which most programmers are steadily sick of. I have FormatMQL project in VS, I link to sources I'm going to use tightly and reformat them to human MS Style.
Nothing like that - I write in two different environments with two different formatting styles - not nauseating.
So don't make it up, just get used to it.
Not at all - I write in two different environments with two different formatting styles - not nauseating.
So don't make it up, just get used to it.
What's missing is a keyboard shortcut to get - block commenting, block indent control.
Look in the Edit -> Advanced menu
Yes, MQ's style is a problem. But convincing them to do at least an adjustment is impossible. This problem is already 10 years old.
Forum on trading, automated trading systems and strategy testing
Sergey Kravchuk, 2009.11.24 11:27
Prehistory: Over many years of coding I developed "my" style of text formatting(here). My texts have been authomatic already for a long time and I have to use Astyle only when I start working with some "alien" text.
Here is the story: Yesterday I received source code of ml5 with some strange (from my point of view) formatting: curly brackets moved to the right in the text for 2 positions, and text inside them is also moved to the right, but only for one position. I tried to use tabulator to get to the same position where there is an opening { in order to put a closing } - did not work.
Can someone (maybe the developers themselves) explain the logic of Metaeditor5 formatting?
Here is a piece of code from MACD Sample.mq5 in their way and in my way:
Styler5 -|- Мой стиль ------- -|- --------- bool CSampleExpert:: LongModified() -|- bool CSampleExpert:: LongModified() { -|- { bool res=false; -|- bool res = false; //--- check for trailing stop -|- //--- check for trailing stop if( InpTrailingStop>0) -|- if ( InpTrailingStop > 0) { -|- { if( m_symbol.Bid()- m_position. Price -|- if ( m_symbol.Bid() - m_position. Pric { -|- { if( m_position. StopLoss()< m_symb -|- if ( m_position. StopLoss() < m_symb { -|- { double sl= m_symbol.Bid()- m_a -|- double sl = m_symbol.Bid() - m_a double tp= m_position. TakePro -|- double tp = m_position. TakeProfi //--- modify position -|- //--- modify position if( m_trade. PositionModify( Sy -|- if ( m_trade. PositionModify( Symbo printf("Long position by -|- printf(" Long position by % s to else -|- else { -|- { printf("Error modifying p -|- printf(" Error modifying positi printf("Modify parameters -|- printf(" Modify parameters : SL } -|- } //--- modified and must exit -|- //--- modified and must exit fro res=true; -|- res = true; } -|- } } -|- } } -|- } //--- -|- //--- return( res); -|- return( res); } -|- }
And further.
Forum on trading, automated trading systems and strategy testing
Combinator, 2009.11.24 14:10
Discuss the MQL5 styler. Started here
I have to look at different code. Including a poorly written one.
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 suggest to either add customization or format in a really common style.
As an option -- make it possible to choose one of 2 or 3 styles.
Yes, MQ's style is a problem. But convincing them to do at least an adjustment is impossible. This problem is now 10 years old.
And further.
The difference is not significant, but the formatting style of MQ is undeniably better.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I would like to suggest developers to standardize indents in MetaEditor when writing code, as it is done in VisualStudio. Because there is no standard indentation in functions and blocks. As a result, the code is less readable. Also when copying and pasting the code, it is inserted askew, some lines are left and some are right. Can you please fix it. And to be able to button normalize all code by indents automatically, it's also implemented in VisualStudio