Features of the mql5 language, subtleties and tricks - page 14

 
Roffild:

You could write an article or a blog - you could edit and discuss them.

But so far there are few solutions to real problems in this thread. I'm even sure that the conversion from MQL to C++, assembly of the DLL by a compiler from Microsoft or GNU, and encryption of this DLL takes place when compiling the code. Too many "features" confirm this. From the recent past: missing the variable value assignment due to intensive code optimization (classic behavior of C++ compilers).

MQL5 is too crude language in OOP. My SD is full of all sorts of "features" that they do not want to fix.

I doubt that the Metakvoters would like it if we publish our bug reports.

Separators in parameters:

enum ENUM_NOTHING {
   NOTHING // ===== ===== =====
};

sinput ENUM_NOTHING z_; // ===== Описание =====
Such a parameter will not affect the continuation of testing after stopping, because the user cannot accidentally change it.


The topic is already started, it is unlikely they will kill it. Post your observations plz.
 

Problem: Create a script that throws red, green, and blue mean lines on the chart.

Solution: ...this is impossible if the color is specified with

#property indicator_color1 clrAqua
Because iCustom() accepts only input
input color indic_col = clrAqua;
Unfortunately, in the standard indicators the color and style are set only through #property.
 
Roffild:

Problem: Create a script that throws red, green, and blue mean lines on the chart.

Solution: ...this is impossible if the color is specified with

#property indicator_color1 clrAqua
Because iCustom() accepts only input
input color indic_col = clrAqua;
Unfortunately, in standard indicators the color and style are set only through #property.
PlotIndexSetDouble(); PlotIndexSetInteger(); PlotIndexSetString();
 
Roffild:

Problem: Create a script that throws red, green, and blue mean lines on the graph.

Solution: ...this is not possible if the color is set with

#property indicator_color1 clrAqua
Because iCustom() only takes input
input color indic_col = clrAqua;
Unfortunately, in the standard indicators the color and style are defined only through #property.

ChartSaveTemplate, then using API we add the desired indicator to the template with any color and ChartApplyTemplate

 
Artyom Trishkin:
PlotIndexSetDouble(); PlotIndexSetInteger(); PlotIndexSetString();

And what to do with ready indicators? For example, iMA()?

Dmitry Fedoseev:

ChartSaveTemplate, then using the API we add the desired indicator to the template with any color and ChartApplyTemplate

What API are we talking about?

 

How to fully replace quadruple AccountFreeMarginCheck()?

Everything I've tried, it all returns a result with an error about insufficient funds to open a position.

 
Roffild:

...

Which API are we talking about?


Try to guess for yourself. Or write your own list of the different APIs you're confused about.
 
Artyom Trishkin:

What is a full-fledged replacement for the quadruple AccountFreeMarginCheck()?

OrderCheck.
 
fxsaber:
OrderCheck.
Oops. Thanks. And I've already made a mess :))
 
Dmitry Fedoseev:

Try to guess for yourself. Or write your own list of different APIs that you are confused with.

I just described the officially confirmed bug. It was you who suggested to use some API to solve this problem.

Please do not confuse creating an indicator and calling it via iCustom.