Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1431
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
---
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?