Unsupported filling mode - page 3

 
Kevin Beltran Keena #:

I wonder if this could be a mistake in the documentation.

When it outputs 2 it is really FoK. 1 is IoC and 0 Return. I would need to check various brokers to see if this is consistent.

EDIT: What I mean to say is that if it outputs 2, you need to set it to 1.

There is no error in the documentation about that.

Use the enum label, not values.

 
Alain Verleyen #:

There is no error in the documentation about that.

Use the enum label, not values.

Thanks!

 

Unsupported filling mode  was the mistake! but it was the minimum volume for BTC the mistake in my code! not the filling mode . this error 4756 is too generic!

 

For reference I use this function which determines from the ORDER_FILLING_TYPE from the SYMBOL_FILLING_MODE (Note the difference).

   request.type_filling=useServerFill(SymbolInfoInteger(_Symbol,SYMBOL_FILLING_MODE));
ENUM_ORDER_TYPE_FILLING useServerFill(long server_fill_type)
  {
   if(server_fill_type==SYMBOL_FILLING_FOK)
      return ORDER_FILLING_FOK;
   else
      if(server_fill_type==SYMBOL_FILLING_IOC)
         return ORDER_FILLING_IOC;
   //default if server for some reason cannot specify filling policy, which is default used anyway
   return ORDER_FILLING_RETURN;
  }
 
salitos #:

For reference I use this function which determines from the ORDER_FILLING_TYPE from the SYMBOL_FILLING_MODE (Note the difference).

Or better yet..

   request.type_filling=useServerFill(SymbolInfoInteger(_Symbol,SYMBOL_FILLING_MODE), ORDER_FILLING_FOK);
ENUM_ORDER_TYPE_FILLING useServerFill(const long server_fill_type, ENUM_ORDER_TYPE_FILLING preferred_fill_type)
  {
   if(server_fill_type==SYMBOL_FILLING_FOK)
      return ORDER_FILLING_FOK;
   else
      if(server_fill_type==SYMBOL_FILLING_IOC)
         return ORDER_FILLING_IOC;
//use preferred if both fill types allowed
   return preferred_fill_type;
  }
 
salitos #:

For reference I use this function which determines from the ORDER_FILLING_TYPE from the SYMBOL_FILLING_MODE (Note the difference).

Hello,

I can use this method to make it even simpler.

https://www.mql5.com/en/forum/428809#comment_40849827

My OrderSend function doesn't work
My OrderSend function doesn't work
  • 2022.07.17
  • www.mql5.com
I am migrating from MQL4 to 5 and having a bump ride. This order placement function I wrote isn't working...
 
salitos #: Or better yet..
Yohana Parmi #: I can use this method to make it even simpler. https://www.mql5.com/en/forum/428809#comment_40849827

I would like to inform both that the "SYMBOL_FILLING_MODE" does not return a single filling mode. It returns a bit flag of multiple allowed filling modes.

You can't just use "==" to find the acceptable filling mode. You have to mask out the flags by doing something like this ...

long nFilling = SymbolInfoInteger( _Symbol, SYMBOL_FILLING_MODE );
if( ( nFilling & SYMBOL_FILLING_FOK ) > 0 )
   g_eOrderFillType = ORDER_FILLING_FOK;
else
   if( ( nFilling & SYMBOL_FILLING_IOC ) > 0 )
      g_eOrderFillType = ORDER_FILLING_IOC;
   else
      g_eOrderFillType = ORDER_FILLING_RETURN;
For more information please reference "Filling Modes" in the documentation.
 
Fernando Carreiro #:

I would like to inform both that the "SYMBOL_FILLING_MODE" does not return a single filling mode. It returns a bit flag of multiple allowed filling modes.

You can't just use "==" to find the acceptable filling mode. You have to mask out the flags by doing something like this ...

For more information please reference "Filling Modes" in the documentation.

@Fernando Carreiro From my tests the server fill policy flag is a long in state 1, 2 or 3(3 being combination of 2 and 1); useServerFill() then tries to be as permissive as possible based on these states. I agree that your code is more concise, though in achieving this while covering all cases (my updated code would cover operations using market orders only).

 
salitos #: @Fernando Carreiro From my tests the server fill policy flag is a long in state 1, 2 or 3(3 being combination of 2 and 1); useServerFill() then tries to be as permissive as possible based on these states. I agree that your code is more concise, though in achieving this while covering all cases (my updated code would cover operations using market orders only).

Unfortunately your updated code is still not able to detect when more then one filling mode is allowed. It can only detect when only a single filling mode is allowed.

At you own explanation, of using 3 (combination of 1 and 2), it would fail with your code, and return the "preferred_fill_type", unable to test if it is allowed or not, and subsequently cause the order to fail if it is not.

 
salitos #:

Or better yet..

it maybe risky if you have you support multiple currency pair EA
Reason: