Could anyone help please?

 
IT KEFT RETURNING "UNSUPPORTED FILLING MODE"  AS I TRIED TO MAKE A SIMPLE BUY ORDER VIA PYTHON SCRIPT. WHY IS THAT? CAN ANYONE HELP PLEASE
 

Forum on trading, automated trading systems and testing trading strategies

Unsupported filling mode just on XAUUSD in Alpari accounts

Fernando Carreiro, 2022.03.08 11:27

Also, did you not properly look at the manual trading panel?


There is a field there for the "Fill Policy" — did you not see it?

Did you not look at the possible options or what is selected as the default?

Are you just placing trades blindly without concerning yourself with what is actually happening?

Did you hit "F1" and read the documentation?

MetaTrader 5 Help → Trading Operations → Basic Principles → Fill Policy

Forum on trading, automated trading systems and testing trading strategies

Unsupported filling mode

Fernando Carreiro, 2017.11.08 22:49

I know it seems quite confusing at first, but maybe a simple analogy might help here. Please don't take any disrespect with this, as I am not trying to dumb it down, just that other users may read the thread too and the analogy might be helpful.

Consider that you are going to a restaurant and when you sit down, they give you a "Menu". On this menu is listed what dishes are available (the broker informs you of what filling modes are available), and then you the customer proceed to choose which dish you want to consume (i.e. of the available filling modes, you choose the one you want to apply). However, the Restaurant can give you different "Menus", depending on where you sit (different symbols), so that dishes can be different.

The same applies here, so you should first use the "SymbolInfoInteger( ... , SYMBOL_FILLING_MODE )" to first obtain information about which filling modes are allowed for a particular symbol (which can be different among Symbols or Accounts or Brokers, etc.)

Once you have the list of available Filling modes, you can then decide which filling mode you want to use in the trade, or if you only want to use a particular Filling mode, you can check to see if it is allowed or not.

Now you can proceed with the order placement, with the appropriate filling mode or not at all if it is not available!

PS! Also remember to consider the following (from the Filling Modes documentation):

EDIT: One more thing, based on experience and not from the documentation. I have had the "displeasure" of cases of where what is reported as allowed for filling mode does not correspond with reality. Where the function confirms that filling mode "A" is allowed, but when I try to us it, it is rejected. So for these cases, I decided to add an input to the EA, where the user can override the selection of the filling mode to the one that is allowed in practice irrespective of what the Symbol Information is reporting. I know this adds to the confusion, but it is a possibility.

Forum on trading, automated trading systems and testing trading strategies

Orders accepted and cancelled right away

Fernando Carreiro, 2017.09.16 00:25

You should not be guessing or using trail and error! You should be checking for the valid Filling Modes for the Symbol in question (see example below).

When sending an order, you can specify the filling policy for the volume set in the order. Allowed order filling modes for each symbol are specified in the table. You can set several modes for one symbol by combining flags. The flags can be combined by the operation of the logical OR (|), for example, SYMBOL_FILLING_FOK|SYMBOL_FILLING_IOC.  In order to check whether a certain mode is allowed for the symbol, the result of the logical AND (&) should be compared to the mode flag.

Fill Policy

Identifier

Value

Description

Fill or Kill

SYMBOL_FILLING_FOK

1

This policy means that a deal can be executed only with the specified volume. If the necessary amount of a financial instrument is currently unavailable in the market, the order will not be executed. The required volume can be filled using several offers available on the market at the moment.

Immediate or Cancel

SYMBOL_FILLING_IOC

2

In this case a trader agrees to execute a deal with the volume maximally available in the market within that indicated in the order. In case the order cannot be filled completely, the available volume of the order will be filled, and the remaining volume will be canceled. The possibility of using IOC orders is determined at the trade server.

Return

No identifier

 

This policy is used only for market orders (Buy and Sell), limit and stop limit orders and only for the symbols with Market or Exchange execution. In case of partial filling a market or limit order with remaining volume is not canceled but processed further.

In the Request and Instant execution modes the Fill or Kill policy is always used for market orders, and the Return policy is always used for limit orders. In this case, when sending orders using OrderSend or OrderSendAsync, there is no need to specify a fill policy for them.

In the Market and Exchange execution modes the Return policy is always allowed for all the order types. To find out whether the other policies are allowed, use the SYMBOL_FILLING_FOK and SYMBOL_FILLING_IOC properties.

Example:

//+------------------------------------------------------------------+
//| Checks if the specified filling mode is allowed                  |
//+------------------------------------------------------------------+
bool IsFillingTypeAllowed(string symbol,int fill_type)
  {
//--- Obtain the value of the property that describes allowed filling modes
   int filling=(int)SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE);
//--- Return true, if mode fill_type is allowed
   return((filling & fill_type)==fill_type);
  }

 
160259807:
IT KEFT RETURNING "UNSUPPORTED FILLING MODE"  AS I TRIED TO MAKE A SIMPLE BUY ORDER VIA PYTHON SCRIPT. WHY IS THAT? CAN ANYONE HELP PLEASE

Also solved here

https://www.mql5.com/en/forum/387410

Market orders always fail because of error #4756 [Unsupported filling mode]
Market orders always fail because of error #4756 [Unsupported filling mode]
  • 2022.01.25
  • www.mql5.com
Hello guys, I plot a line in my chart, called "sl". Then I execute my code and I always receive this [Unsupported filling mode] error #4756...
 
Fernando Carreiro #:
Thank you.