I was using MqlTradeRequest and OrderSend() to open my positions. But now I am thinking of updating my code and to use CTrade and PositionOpen() instead.
But I have a couple of doubts about it. (Deviation, MagicNumber and How to handle errors).
In the following code: Is it properly structured? (Deviation and MagicNumber)
If an error occurs in the PositionOpen() function, is there a possibility that a misconfigured position will be opened? For example, without stop loss? I will need close it using PositionClose()?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I was using MqlTradeRequest and OrderSend() to open my positions. But now I am thinking of updating my code and to use CTrade and PositionOpen() instead.
But I have a couple of doubts about it. (Deviation, MagicNumber and How to handle errors).In the following code:
Is it properly structured? (Deviation and MagicNumber)
If an error occurs in the PositionOpen() function, is there a possibility that a misconfigured position will be opened? For example, without stop loss? I will need close it using PositionClose()?
Thank you so much!!