The solution to this problem is the position property of the request structure. Unfortunately, the use of position in the reference book is not described in sufficient detail, but in practice we were able to establish the following: you need the position property when closing and modifying, where the modifier is explicitly specified. If you open a new position after closing, you must specify position=0; otherwise, the robot will attempt to close or modify the position with the old value in this field, which generates the "Invalid Request" error.
Questions from Beginners MQL5
Errors, bugs, questions
[WARNING CLOSED!] Any newbie
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