The EA will not always open both pending buy and sell orders. I am not sure whether it is due to a fast moving market or the code is erroneous (it does compile). The orders are sent when the desired tick volume for the current bar have been reached.
The EA will not always open both pending buy and sell orders. I am not sure whether it is due to a fast moving market or the code is erroneous (it does compile). The orders are sent when the desired tick volume for the current bar have been reached.
The EA will not always open both pending buy and sell orders. I am not sure whether it is due to a fast moving market or the code is erroneous (it does compile). The orders are sent when the desired tick volume for the current bar have been reached.
So why not find out why and fix the issue ? why aren't you checking the return value from your OrderSend() calls ? if they fail you can then Print() the error and any variables that will help determine the problem, for example, Bid, Ask, Open price, SL, TP, etc.
Thanks for your reply. According to the experts journal in the terminal, it says invalid lots amount for OrderSend function. Doesn't make sense when the margin is there to open the order and it opened the pending sell but not the pending buy.
Check the return value from the OrderSend() if it shows the OrderSend() failed print the Error and relevant variables . . . including lotSize2 then you can check that value against MarketInfo() with MODE_MINLOT & MODE_LOTSTEP
So you get error 131 ? what does that have to do with margin ? if it was not enough money wouldn't you expect error 134 ?
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.
The EA will not always open both pending buy and sell orders. I am not sure whether it is due to a fast moving market or the code is erroneous (it does compile). The orders are sent when the desired tick volume for the current bar have been reached.
The EA will not always open both pending buy and sell orders. I am not sure whether it is due to a fast moving market or the code is erroneous (it does compile). The orders are sent when the desired tick volume for the current bar have been reached.
The EA will not always open both pending buy and sell orders. I am not sure whether it is due to a fast moving market or the code is erroneous (it does compile). The orders are sent when the desired tick volume for the current bar have been reached.
So why not find out why and fix the issue ? why aren't you checking the return value from your OrderSend() calls ? if they fail you can then Print() the error and any variables that will help determine the problem, for example, Bid, Ask, Open price, SL, TP, etc.
This will help: What are Function return values ? How do I use them ?
Thanks for your reply. According to the experts journal in the terminal, it says invalid lots amount for OrderSend function. Doesn't make sense when the margin is there to open the order and it opened the pending sell but not the pending buy.
Check the return value from the OrderSend() if it shows the OrderSend() failed print the Error and relevant variables . . . including lotSize2 then you can check that value against MarketInfo() with MODE_MINLOT & MODE_LOTSTEP
So you get error 131 ? what does that have to do with margin ? if it was not enough money wouldn't you expect error 134 ?