How to enter a new order only if / when the first one has been executed (filled)? [MQL5]

Viewed 567

I'm kinda of new in MQL5.

I have an EA that buys one stock first (let's say PETR4) and then buys another one (let's say ABEV3).

The only problem is that I can only order the second one when the first one is executed (not only placed).

I used the MqlTradeResult.retcode to get the return number, but that only shows if the order has been placed and I need to know if the order has been filled in order to continue with the second operation.

Can anyone help me? Thanks

1 Answers
Related