double volume = m_position.Volume() / 2.0; ulong roundedVolume = (ulong)MathRound(volume);
You can't just use OrderLots()/2 because that is not a multiple of LotStep, and you can't close or have remaining less than MinLot.
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
William Roeder #: You can't just use OrderLots()/2 because that is not a multiple of LotStep, and you can't close or have remaining less than MinLot.
First of all thank you , I edited the codes again. double tempRoundedVolume = MathRound(halfVolume / lotStep); ulong roundedVolume = (ulong)tempRoundedVolume * (ulong)lotStep;
but I keep getting the same warning.
2024.02.05 19:12:02.715 Scripts script Yarısını Kapat (USDJPY,H1) loaded successfully
after
2024.02.05 19:12:02.733 Scripts script Yarısını Kapat (USDJPY,H1) removed
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
Hello, I coded a script for Metatrader 5. I'm not getting a compilation error but I'm getting a warning I need help.