Unsupported filling mode

 

 here is test script:

MqlTradeRequest request;  
MqlTradeResult result; 


void OnStart()
{
      request.action = TRADE_ACTION_DEAL;
      request.symbol = "AUDCAD";
      request.volume = 0.01;
      request.type = ORDER_TYPE_BUY;
      request.type_filling = ORDER_FILLING_FOK;///
      request.comment = "";
      request.magic = 0;

         request.price = 0;
         request.sl = 0;
         request.tp = 0;
         request.deviation = 0;

      OrderSend(request,result);

}

 it works on ForexTime-ECN but fail on FxPro-ECN.

here is error log: 

2015.05.08 22:08:39.046 Trades '5007498': failed market buy 0.01 AUDCAD [Unsupported filling mode]

 

anyone know what happen? 

 
Jinsong Zhang:

 here is test script:

 it works on ForexTime-ECN but fail on FxPro-ECN.

here is error log: 

2015.05.08 22:08:39.046 Trades '5007498': failed market buy 0.01 AUDCAD [Unsupported filling mode]

 

anyone know what happen? 

Really, an old member like you don't know that ?

You have to check the filling mode accepted by your symbol. See SYMBOL_FILLING_MODE.

Documentation on MQL5: Market Info / SymbolInfoInteger
Documentation on MQL5: Market Info / SymbolInfoInteger
  • www.mql5.com
Market Info / SymbolInfoInteger - Reference on algorithmic/automated trading language for MetaTrader 5
 
Alain Verleyen:

Really, an old member like you don't know that ?

You have to check the filling mode accepted by your symbol. See SYMBOL_FILLING_MODE.

Thanks, I'll check it.
 

Rather similar problem here (also on FxPro MT5):

I have a pending sell stop order with ticket number nTicket and open price fOpenPrice, now I try to push its take profit further away from open price by calling

CTrade::OrderModify( nTicket, fOpenPrice, 0, fTakeProfit, ORDER_TIME_GTC, 0 )

but it fails with error code 10030 (invalid fill). Journal message: "failed order #9 sell stop 0.01 at 128.47000 sl: 0.00000 tp: 128.28700 -> 128.47000, sl: 0.00000 tp: 127.78700 [Unsupported filliing mode]"

Of course I tried all possible settings for CTrade::SetTypeFilling(), but nothing helps. SymbolInfoInteger( _Symbol, SYMBOL_FILLING_MODE ) returns 2 (ORDER_FILLING_IOC = Immediate or Cancel).

Any advice warmly appreciated :-)

 

Hi

I have the same problem with FxPro.

First I used IronFX MT5 (demo) with no problems and later FXpro also with no problems but since a few weeks ago, I get the same "Unsupported filling mode" error.

This is my code for the buy trade.

// Define some MQL5 Structures we will use for our trade   
         MqlTradeRequest mrequest;   
         MqlTradeResult mresult;   
         ZeroMemory(mrequest);   
         ZeroMemory(mresult);

// Alleen bij een correcte trade size mag het model de positie openen.                      
               if(dTradePosition_Size <= dDynamicPosition_Trading_Size && dTradePosition_Size > 0)                     
                     {  
                     Alert("Het model gaat een KOOP order openen voor de: ", Symbol(), " met prijs: ", NormalizeDouble(Latest_Price.ask, Digits()), " en trade size: ", dTradePosition_Size);
                                             
                     mrequest.action         = TRADE_ACTION_DEAL;                            // immediate order execution stoploss en takeprofit worden aangepast
                     mrequest.price          = NormalizeDouble(Latest_Price.ask, Digits());  // latest ask price
                     mrequest.symbol         = Symbol();                                     // currency pair
                     mrequest.volume         = dTradePosition_Size;                          // number of lots to trade
                     mrequest.magic          = EA_Magic_Number;                              // Order Magic Number
                     mrequest.type           = ORDER_TYPE_BUY;                               // Buy Order
                     mrequest.type_filling   = ORDER_FILLING_RETURN;                         // Order execution type 
                     mrequest.deviation      = 1000;                                         // Max prijs afwijking
                                                                                                       
                     if(OrderSend(mrequest,mresult) == true) {Alert("De order is met prijs: ", Latest_Price.ask, " naar de markt gestuurd!");}                                     
                     Sleep(375); // 0.375 seconden vertraging om de order te verwerken.
                     Alert("Antwoordcode van trade server = ", mresult.retcode);                                                       
                     if(mresult.retcode == 10008 || mresult.retcode == 10009) //Request is completed
                           { 
                           nTradeCounter++; 

// Check de model versie voor het afspelen van geluid.
                           if(EA_Magic_Number == 100 || EA_Magic_Number == 102)
                                 {
                                 PlaySound("OpenTrade"); // Geluid afspelen.
                                 }

// Melding van het scenario type weergeven nadat de trade is geopend.
                           Alert("Een Koop order voor scenario type: ", nOpenTrade_ScenarioType, " is succesvol uitgevoerd!  Trade volume: ", dTradePosition_Size);                                                                                                              
                           }
                           else
                           {
                           Alert("The Buy order request could not be completed -error:",GetLastError());
                           ResetLastError();           
                           return;
                           }                              
                     }
                     else // Het trade volume is niet goed berekend. 
                     {
                     Alert("Het berekende volume is onjuist!!!  ", dTradePosition_Size);
                     } 
 
I'm having the same problem in trade.PositionClose
 
Joao Luiz Sa Marchioro:
I'm having the same problem in trade.PositionClose
Look at here.
 
Jinsong Zhang:

 here is test script:

 it works on ForexTime-ECN but fail on FxPro-ECN.

here is error log: 

2015.05.08 22:08:39.046 Trades '5007498': failed market buy 0.01 AUDCAD [Unsupported filling mode]

 

anyone know what happen? 


Uh-oh, this is quite interesting, because different Brokers deliver different SYMBOL_FILLING_MODEs on the same symbol. Just try this

void OnTick()
  {
      int FillingMode=(int)SymbolInfoInteger(_Symbol,SYMBOL_FILLING_MODE);
      
      Comment (
           "Filling Mode: ",FillingMode,
         "\nSymbol      : ", SymbolInfoString(_Symbol, SYMBOL_DESCRIPTION),         
         "\nAccount Company: ", AccountInfoString(ACCOUNT_COMPANY),
         "\nAccount Server : ", AccountInfoString(ACCOUNT_SERVER));  
  }

...and wonder, why they have different results for SYMBOL_FILLING_MODE on the same _Symbol. IMHO, this looks frightening to me... Who is right? And Filling Mode 3 is ORDER_FILLING_FOK, what - again imho should work on all orders...

I am new to FX EA programming, so, sorry the stupid question: Is it OK, that different Broker have different Filling Modes?

Broker 1 - Demo Account

 Broker 2 - also Demo Account


Best regards, Roland

 
Roland Rick:

Is it OK, that different Broker have different Filling Modes?

Yes.

 
fxsaber:

Yes.


Thanks! - But also for the same currency pair? I forgot to mention this above, sorry!

 
Roland Rick:

also for the same currency pair?

Yes.

Reason: