[MT4] Limit orders - page 2

 
Yohana Parmi:

Yes, I know how difficult it is.

This business has very complex system, and we should not expect it perfect. At least need time.

Something made by humans must have weaknesses. We can report it, and it can be fixed. (^̮^)

But, unfortunately the risk can not be eliminated or fixed.

It can only be reduced ˙ ͜ʟ˙


Yes, but I was referring to the risk of unknown slippage on entry orders. If you use a limit order there is no risk of slippage the only risk is not getting filled which is better than getting filled with a massive slip. When placing a limit order on the MT platform at the current market price - it is in-effect a Stop Limit Order NOT a limit order since the market price has to move beyond the limit price for it to become an active limit order.

As far as being optimistic of a fix...MQ has unfortunately abandoned this platform... I've already reported some critical errors in the std lib, and included the code to fix them, but they won't even address that let alone changing their order processing, which I presume has been that way for a very long time by now, and I assume that I was designed that way on purpose with the broker coming out ahead.

 

After some more testing I realize I was wrong about the limit having to be < than market. It can be <=market, but it will not become an active order until the next tick! The price field in the terminal trade table turns yellow and stays yellow until the next tick. If the next tick <= to the limit it fills. 

//+------------------------------------------------------------------+
//|                                               LimitOrderTest.mq4 |
//|                                                      nicholishen |
//|                            http://www.reddit.com/u/nicholishenFX |
//+------------------------------------------------------------------+
#property copyright "nicholishen"
#property link      "http://www.reddit.com/u/nicholishenFX"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   if(!IsDemo())
      return INIT_FAILED;
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
   for(int i=OrdersTotal()-1;i>=0;i--)
   {
      if(OrderSelect(i,SELECT_BY_POS) && (OrderType()==OP_BUY || OrderType()==OP_SELL))
      {
         double price = OrderType()==OP_BUY ? Bid : Ask;
         if(OrderClose(OrderTicket(),OrderLots(),price,100))
            return;
      }
      
   }
   if(OrdersTotal() == 0)
      if(OrderSend(Symbol(),OP_BUYLIMIT,0.01,Ask,0,0,0)>=0)
         return;

   
}
//+------------------------------------------------------------------+
Reason: