Pending order didn't change to Open - only after client terminal reset (ERR_INVALID_TRADE_PARAMETERS) - page 2

 

That's weird. Invalid SL/TP for pendings.

I have no idea what to say right now.


This is what RaptorUK meant (https://www.mql5.com/en/forum/139654), though I don't think that will help much.

#include <stdlib.mqh>
int start()
  {
  int total = OrdersTotal();
  for(int i = total ;i > 0;i--) // <<== count down to zero when closing or deleting https://forum.mql4.com/48352
     {
      if (OrderSelect(i,SELECT_BY_POS) == true)
        {
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) 
            {
            Print("Ticket="+OrderTicket()+", Status=OPEN");
            }
            else
            {
            Print("Ticket="+OrderTicket()+", Status=PENDING");
            if (OrderDelete(OrderTicket()) == false)
                Print("Failed to delete Pending Ticket. Error="+ErrorDescription(GetLastError()));
            }
         }
      }   
   return (1);
   }
 
onewithzachy:

That's weird. Invalid SL/TP for pendings.

I have no idea what to say right now.

It's not a FIFO thing is it ? I have no experience with such things . . just wondered.
 
RaptorUK:
It's not a FIFO thing is it ? I have no experience with such things . . just wondered.

Nope, that will be err 150 : "prohibited by FIFO rules", or err 149 - if any - : "hedging is prohibited".

Is it because FXCentral is ECN ?, but I don't think that either. From first post, I think it just some slow connection.

 

Hi Guys,

I've been looking around the net and found 2 other similar posts

1. http://for um.mql4.co mhttps://www.mql5.com/en/forum/110843

2. http://www .forextrad ersdaily.c om/blog/20 12/01/23/f orex-news- trading-tr ades-for-t uesday-jan -24-2012/
"Sham, your broker kept you out. If they don’t want to let you in, this is the message they generate. You are lucky not to have gotten in."

This is starting to look more and more like a bug in the trader. When I look at the UI I can see the trade still stuck in Pending but it's colored in Yellow instead of Green.

Do you know how I can submitt a bug report directly to MetaTrader? The broker I talked to has no idea what to do, as the platform is owned by MT4

Thanks,

 
I wonder if it's some kind of double variable precision issue on the SL or TP ? perhaps you might be able to work around it by using a very large number for the SL for a pending Sell and a very large number for the TP for a pending Buy . . .
 

You meant submit bug report to MetaQuotes coz MT 4 is owned by MetaQuotes ?, You can use your service desk at MQL5.com. I use that for my MT4 things several times in the past.

B TW,y ou' rer ea lly d on 't h avet o sp a ce t hel ink s. :)

:D

 
  1. For ECN brokers, you must open first and then set stops. This may also be true for pending orders, must wait until open and then set?
  2. Pending order are good for Humans as they can't stare at the screen 24/5. Why bother with EA's? Just wait for the price to reach your trigger and open regularly.
 
You are not alone, having the same problem and also got MT4 Server logs there that confirm the order was opened at the broker already but Terminal still thought it is not open: https://forum.mql4.com/52061
 
RaptorUK:
First obvious thing you are doing wrong: Loops and Closing or Deleting Orders your loop is actually wrong in 2 ways . . . read the thread it will help you.
This Article is no longer correct if you take into account US FIFO brokers.  You actually have to increase with cnt++ and reset the cnt after each successful deletion/close (start over the cycle).  A FIFO broker will require orders being deleted in the position they are opened, requiring you to increase and not decrease your cnt integer.
 
Freedom787:
This Article is no longer correct if you take into account US FIFO brokers.  You actually have to increase with cnt++ and reset the cnt after each successful deletion/close (start over the cycle).  A FIFO broker will require orders being deleted in the position they are opened, requiring you to increase and not decrease your cnt integer.
Please delete your comment and reply over there. So we have everything in order :). And by the way, I can show you that your logic for deleting FIFO is wrong.
Reason: