After some testing I found that it was because I was doing it asynchronous. So i guess it was printing the variables before the trade was set. The problem I find with this is that my script will have to wait to the position to be placed for it to keep managin the orders.
Is it a bad practice if I do it sinchronous? Is there any other solution?
Thank you.
Is it a bad practice if I do it sinchronous? Is there any other solution?
Thank you.

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
I'm trying for the first time this class and followed this guide https://www.mql5.com/en/articles/481 . Problem is that after placing the order I need to get the ticket because I'm trying to manage the operations by myself. The problem is that even the operation is placed and it has a ticket, a price, volume, etc. When asking this information it returns me 0.
Here the code and the print out.
Thank you.