I am currently trying out a pairs trading EA on GBPUSD-EURUSD. The EA is attached to the GBPUSD chart on live trading (not backtesting). I have the following code ...
if (Condition ...)
{
Ticket = OrderSend("GBPUSD", OP_SELL, Lots, Bid, Slippage, Ask+StopLoss*Point, Bid-TakeProfit*Point, "MyEA", Magic_Num, 0, Red);
if (Ticket < 1) Print("Order Close failed with error #" + GetLastError());
Ticket = OrderSend("EURUSD", OP_BUY, Lots, Ask, Slippage, Bid-StopLoss*Point, Ask+TakeProfit*Point, "MyEA", Magic_Num, 0, Blue);
if (Ticket < 1) Print("Order Close failed with error #" + GetLastError());
}
The problem is that only GBPUSD orders are being opened. I don't even get an error report for the EURUSD. Is it that EA's can only place orders for the instrument chart that they are attached to?
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.
Hi,
I am currently trying out a pairs trading EA on GBPUSD-EURUSD. The EA is attached to the GBPUSD chart on live trading (not backtesting). I have the following code ...
The problem is that only GBPUSD orders are being opened. I don't even get an error report for the EURUSD. Is it that EA's can only place orders for the instrument chart that they are attached to?
Thx