0

In my expert advisor that I've written, sometimes my call to OrderSend Opens a window, The one you get in mt4 terminal mode when you right click on a ticket and select modify or delete. I have to manually select to send or cancel the order. It does not generate any error. It even generates a ticket number but does not take the trade. It works fine in strategy tester. This causes me to sometimes miss trades.

`Print("OpenLongPosition Executed. Did it buy?");
if (OrderSend(Symbol(),OP_BUY, Lot, Ask, slippage, 0, 0, "Buy", 1, 0, Green))
{
     lastAskPrice = Ask;
     lastBidPrice = Bid;
     NextBuyCross = false;
     ShowStatus();
{
else 
     Print("OPEN LONG POSITION FAILED ERROR # " + GetLastError());

I've made sure 'enable automatic trading' is enabled, 'allow automated trading' is checked, placed print before the OrderSend to insure it is being called. My order close function works fine. I expect the Buy order to succeed without intervention or give an error message. Please make any suggestions. Thank you.

Correction: On last order, it did go through even though I just closed the window that pops up but was not showing up until later.

0 Answers0