Market Validation Issue: Semi-Discretionary EA - Unsupported Filling Mode

 

Hello MQL5 Forum,

I am trying to publish a semi-discretionary Expert Advisor (TradeManager Semi Discretionary EA for Mt5, Product ID: 178835) on the MQL5 Market, but the automatic validation keeps failing with the following error:

   failed market buy 0.2 EURUSD [Unsupported filling mode]

This error occurs 3 times (trying all filling modes: IOC, FOK, and RETURN), and the tester reports 1 total trade attempt.

My EA is a semi-discretionary tool — entry orders are placed manually by the trader using on-chart buttons (BUY NOW / SELL NOW). To support the automatic validation, I have implemented an Auto Test Mode (InpAutoTestMode = true by default) that fires an automatic entry at a specified bar number during Strategy Tester runs.

The EA correctly detects the account margin mode (ACCOUNT_MARGIN_MODE_RETAIL_NETTING) and sets ORDER_FILLING_RETURN accordingly. However, all three filling modes are rejected in the validation environment.

My questions:
1. Is there a specific filling mode or order configuration required for the MQL5 Market validation tester?
2. Is it possible to request a manual review for semi-discretionary EAs that cannot be fully automated by design?
3. Are there any specific requirements for semi-discretionary EAs to pass Market validation?

Thank you for your assistance.

Best regards,
Yasuhiro Ishihara
MQL5 username: yasmaze
 

It sounds like you're checking Netting/Hedge modes accounts, but you're randomly trying different filling modes. Are you checking allowed filling modes?

Forum on trading, automated trading systems and testing trading strategies

Filling Mode

Vladimir Karputov, 2021.08.16 17:35

View the help: Symbol Properties

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);
  }

 
Yasuhiro IshiharaMy EA is a semi-discretionary tool — entry orders are placed manually by the trader using on-chart buttons (BUY NOW / SELL NOW). To support the automatic validation, I have implemented an Auto Test Mode (InpAutoTestMode = true by default) that fires an automatic entry at a specified bar number during Strategy Tester runs.
In the general application information specifications, under Product, please specify "Utilities" (not "Experts"). 👍 And please remove that workaround you described (highlighted in red).