Download MetaTrader 5
To add comments, please log in or register
Do you need a programmer? Freelance service will find the developer you need!
Jinsong Zhang
15358
Jinsong Zhang 2015.05.08 16:23 

 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? 

Alain Verleyen
Moderator
30299
Alain Verleyen 2015.05.08 20:44  
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
Jinsong Zhang
15358
Jinsong Zhang 2015.05.10 08:00  
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.
FuryPferd
7
FuryPferd 2016.06.26 12:30  

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 :-)

Snelle Moda
602
Snelle Moda 2016.06.26 13:41  

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);
                     } 
/
To add comments, please log in or register