Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Expert Advisor | Symbol Filling Policy Determination

MetaTrader Experts, Indicators, Scripts and Libraries

Symbol Input (symbol): The function takes as input the symbol of a financial instrument for which the filling policy is to be determined.

  1. Obtaining the Filling Policy Type (filling): The function uses SymbolInfoInteger to retrieve information about the filling policy for the provided symbol. This information is stored in a variable named filling as a numerical value.
  2. Comparison of Filling Policies: Next, the numerical value (filling) is compared with predefined constants representing different filling policies, such as "Fill or Kill" (SYMBOL_FILLING_FOK), "Immediate or Cancel" (SYMBOL_FILLING_IOC), and "Return" (SYMBOL_FILLING_RETURN).
  3. Returning the Filling Policy Type: The function determines the filling policy type based on the comparison. If it matches "Fill or Kill," it returns ORDER_FILLING_FOK. If it matches "Immediate or Cancel," it returns ORDER_FILLING_IOC. If it doesn't match either, it returns ORDER_FILLING_RETURN.

In summary, this function allows you to retrieve and return the filling policy of a symbol in MetaTrader 5. This is useful for making trading decisions based on the filling policy of a specific financial instrument.

46578