you must use the order Id to modify it. In your code there is no way for the second order_send to locate the original order.
https://www.mql5.com/en/docs/constants/structures/mqltraderequest
position | Ticket of a position. Should be filled in when a position is modified or closed to identify the position. As a rule it is equal to the ticket of the order, based on which the position was opened. |
in your case, position = li_4.order

Documentation on MQL5: Constants, Enumerations and Structures / Data Structures / Trade Request Structure
- www.mql5.com
Interaction between the client terminal and a trade server for executing the order placing operation is performed by using trade requests. The...

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
Print:
order_send failed, retcode=10036