Don't tell me, I found a chip, the MCs still have not corrected the loan of the name of one of the main functions, killed a lot of time reading and searching for it
Обычно в названии функции стремятся отобразить ее основное назначение. Читабельные программы, как правило, содержат разнообразные и грамотно подобранные идентификаторы. Иногда различные функции используются для одних и тех же целей. Например, рассмотрим функцию, которая вычисляет среднее значение массива чисел двойной точности, и такую же...
В настоящее время мультивалютных торговых систем, индикаторов и экспертов разработано огромное количество. Тем не менее, до сих пор создатели этого "огромного количества" сталкивались со специфическими для мультивалютных систем трудностями. С выпуском в свет терминала MetaTrader 5 и языка программирования MQL5 появилась возможность реализации...
I'm sure all of you use the crosshair tool on MetaTrader's charts. It's very useful to measure distance in bars or points between 2 spots. Yet I was always wondering, why it does not provide an option to show profit value, margin level, drawdown or gain percentage in addition to points. To remedy this problem I've developed a MQL program, which...
voidOnTradeTransaction ( constMqlTradeTransaction &Trans, constMqlTradeRequest &Request, constMqlTradeResult &Result )
{
if (Trans.type =TRADE_TRANSACTION_REQUEST) // 'type' - constant cannot be modified
Imagine how long it would take to find an error in a large code if instead of "==" you wrote "=". Here, on the other hand, the compiler itself tells you everything at once, thanks to const.
Imagine how long it would take to find an error in a large code if you wrote "==" instead of "=". Here, thanks to const, the compiler itself tells you everything right away.
In such cases, you can start the comparison with a constant, which is even better.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Don't tell me, I found a chip, the MCs still have not corrected the loan of the name of one of the main functions, killed a lot of time reading and searching for it
https://www.mql5.com/ru/docs/basis/function/functionoverload
https://www.mql5.com/ru/docs/basis/function/functionoverload
got it thanks
Special thanks to Konstantin Gruzdev
Implementation of Multi-currency Mode in MetaTrader 5Application
Result
Application
Result
If it is possible to use MQL to describe a function, the number of arguments of which is not defined, e.g.
Print(arg1,arg.......) or StringConcatenate(string_var,void argument1,void argument2, .......)
If it is possible to use MQL to describe a function with an undefined number of arguments, such as
Print(arg1,arg.......) or StringConcatenate(string_var,void argument1,void argument2, .......)
It's possible to come up with something based on macros, but it's crutchy.
Templates + passing arrays/structures allow to realize many ideas.
It is possible to come up with something based on macros, but it is crutchy.
Templates + passing arrays/structures allow you to implement many ideas.
Thanks, that's what I thought, no need in principle, but watching your codes, I thought, what if you can do that?
Forum on trading, automated trading systems and trading strategies testing
Peculiarities of mql5 language, tips and tricks
fxsaber, 2017.02.27 18:40
bool MyOrderCalcMargin( const ENUM_ORDER_TYPE action, const string symbol, const double volume, const double price, double &margin )
Here is a cross-platform prof. implementation.
Imagine how long it would take to find an error in a large code if instead of "==" you wrote "=". Here, on the other hand, the compiler itself tells you everything at once, thanks to const.
fxsaber:
Imagine how long it would take to find an error in a large code if you wrote "==" instead of "=". Here, thanks to const, the compiler itself tells you everything right away.
In such cases, you can start the comparison with a constant, which is even better.
In such cases, you can start the comparison with a constant - even better.
Yes, I just created an example for such a case
if (Trans.type = Variable)