But it must be arrayed from the string in OnInit()
Thank you very much! I considered this option, but because of my illiteracy as a coder something went wrong)), but now if you allow me one more question. All works, but there is a warning: implicit conversion from 'string' to 'number', how to remove it? Is it possible?
Александр: Thank you very much! I considered this option, but because of my illiteracy as a coder something went wrong)), but now if you allow me one more question. Everything works, but I get a warning: implicit conversion from 'string' to 'number', how do I get rid of it? Is it possible?
Colleagues, help with the algorithm and mathematical functions, you can just use mathematical functions, the task is to close a market position by 5 portions.
I.e. for example a market position of 10.24 lots or 5.12 lots should be covered with approximately equal parts of 5 parts. We can make one of the remaining ones larger than the others to cover the remaining volume after the first four positions have been closed.
This topic from the help of mate functions is not quite suitable, in my opinion, it needs something to complete.... HOW to optimally count lots of each of 5 shares (parts) to close a common position.
Возвращает вещественный остаток от деления двух чисел.
double MathMod(
doublevalue, // делимое double value2 // делитель
);
Параметры
value
[in] Значение делимого.
value2
[in] Значение делителя.
Возвращаемое значение
Функция MathMod рассчитывает вещественный остаток f от val / y таким образом, что val = i * y + f , где i является целым числом, f имеет тот же знак, что и val, и абсолютное значение f меньше, чем абсолютное значение y.
Примечание
Вместо функции MathMod() можно использовать функцию fmod().
Colleagues, help with the algorithm and mathematical functions, you can just use mathematical functions, the task is to close a market position by 5 portions.
I.e. for example a market position of 10.24 lots or 5.12 lots should be covered with approximately equal parts in total of 5 parts. We can make one of the remaining ones larger than the others to cover the remaining volume after the first four positions have been closed.
This topic from the help of mate functions is not quite suitable, in my opinion, it needs something - something to complete .... HOW to optimally count lots of each of the 5 parts (parts) to close a common position.
A division by 5 is a division by 5 :-)
lots_1to4=NormalizeLots(lots/5);// лоты для 1,2,3,4 ; округление лота сами добавите
О! Spc. Exactly - through the difference of rounded down and the starting total!!! Rounding through the same?
Возвращает ближайшее снизу целое числовое значение.
doubleMathFloor(
double val // число
);
Параметры
val
[in] Числовое значение.
Возвращаемое значение
Числовое значение, представляющее наибольшее целое число, которое меньше или равно val.
Примечание
Вместо функции MathFloor() можно использовать функцию floor().
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.
---
But it must be arrayed from the string in OnInit()
All works, but there is a warning: implicit conversion from 'string' to 'number' , how to remove it? Is it possible?
Thank you very much! I considered this option, but because of my illiteracy as a coder something went wrong)), but now if you allow me one more question.
Everything works, but I get a warning: implicit conversion from 'string' to 'number' , how do I get rid of it? Is it possible?
Re-posted the code
That's the way it is around here... good code should be plenty.
Afternoon
Trying to create 2 files for MT4-MT5 copier:
When trying to read :Same code in MT5 writes everything correctly:
Is it me having some kind of problem or has something crashed in MT4?
Colleagues, help with the algorithm and mathematical functions, you can just use mathematical functions, the task is to close a market position by 5 portions.
I.e. for example a market position of 10.24 lots or 5.12 lots should be covered with approximately equal parts of 5 parts. We can make one of the remaining ones larger than the others to cover the remaining volume after the first four positions have been closed.
This topic from the help of mate functions is not quite suitable, in my opinion, it needs something to complete.... HOW to optimally count lots of each of 5 shares (parts) to close a common position.
Colleagues, help with the algorithm and mathematical functions, you can just use mathematical functions, the task is to close a market position by 5 portions.
I.e. for example a market position of 10.24 lots or 5.12 lots should be covered with approximately equal parts in total of 5 parts. We can make one of the remaining ones larger than the others to cover the remaining volume after the first four positions have been closed.
This topic from the help of mate functions is not quite suitable, in my opinion, it needs something - something to complete .... HOW to optimally count lots of each of the 5 parts (parts) to close a common position.
A division by 5 is a division by 5 :-)
lots_1to4=NormalizeLots(lots/5); // лоты для 1,2,3,4 ; округление лота сами добавите
lots5 = NormalizeLots(lots - lots_1to4*5); // для 5 - оставшиеся лоты
a division by 5 is a division by 5 :-)
lots_1to4=NormalizeLots(lots/5); // лоты для 1,2,3,4 ; округление лота сами добавите
lots5 = NormalizeLots(lots - lots_1to4*5); // для 5 - оставшиеся лоты
О! Spc. Exactly - through the difference of rounded down and the starting total!!! Rounding through the same?