Unsupported filling mode just on XAUUSD in Alpari accounts

 

Hello,

I can open and close all of different trades using python and MetaTrader5 library easily. Although, I can easily open a position on XAUUSD manually on MetaTrader 5 and also I added  XAUUSD  inside of Market Watch, I cannot open any position on  XAUUSD via python. It returns "Unsupported filling mode" in its comment and return "0" ticket number. Would you please help me?


Thanks

 
TrexTrader: I can open and close all of different trades using python and MetaTrader5 library easily. Although, I can easily open a position on XAUUSD manually on MetaTrader 5 and also I added  XAUUSD  inside of Market Watch, I cannot open any position on  XAUUSD via python. It returns "Unsupported filling mode" in its comment and return "0" ticket number. Would you please help me?

Before posting, first do your research. There are allready many threads in the forum about unsupported filling mode: https://www.mql5.com/en/search#!keyword=Unsupported%20filling%20mode&module=mql5_module_forum

Take some time to understand filling mode and how to set it properly. Also read-up on the MQL5 documentation on volume filling policy. Even if it is not about Python but about MQL5, the information is still relevant.

 
Fernando Carreiro #:

Before posting, first do your research. There are allready many threads in the forum about unsupported filling mode: https://www.mql5.com/en/search#!keyword=Unsupported%20filling%20mode&module=mql5_module_forum

Take some time to understand filling mode and how to set it properly. Also read-up on the MQL5 documentation on volume filling policy. Even if it is not about Python but about MQL5, the information is still relevant.

Thanks. But I have checked before sending the question. The other questions answered like this:

"You have to check the filling mode accepted by your symbol". How should I check this?

 
TrexTrader #:

How should I check this?

in the symbol specification

 
TrexTrader #: "You have to check the filling mode accepted by your symbol". How should I check this?

As I stated and I quote:

"Take some time to understand filling mode and how to set it properly. Also read-up on the MQL5 documentation on volume filling policy. Even if it is not about Python but about MQL5, the information is still relevant."

Documentation on MQL5: Integration / MetaTrader for Python / symbol_info
Documentation on MQL5: Integration / MetaTrader for Python / symbol_info
  • www.mql5.com
symbol_info - MetaTrader for Python - Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
TrexTrader: Although, I can easily open a position on XAUUSD manually on MetaTrader 5 ...

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
Basic Principles - Trading Operations - MetaTrader 5 Help
Basic Principles - Trading Operations - MetaTrader 5 Help
  • www.metatrader5.com
Before you proceed to study the trade functions of the platform, you must have a clear understanding of the basic terms: order, deal and position...
 

If you are using the class CTrade to open trades, You have to set type filling by symbol before you can open any trade with the library

#include <Trade\Trade.mqh> 
//---
CTrade   m_trade;
then
void OnTick()
 {
   m_trade.SetTypeFillingBySymbol(Symbol()); //set type filling for the current symbol  
   
   if (your condition)
      { 
        m_trade.Buy(condition);
      }
  }

if the best practice would be to call the function  

m_trade.SetTypeFillingBySymbol(Symbol());

on the Init(), Unless you are working with Multicurrency Expert Advisors

Documentation on MQL5: Standard Library / Trade Classes / CTrade
Documentation on MQL5: Standard Library / Trade Classes / CTrade
  • www.mql5.com
CTrade - Trade Classes - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5