MT5 (UNSUPPORTED FILLING MODE) Novo comentário

 
For personnel who are having problems filling out order in MT5 (UNSUPPORTED FILLING MODE) I was able to solve with the following changes within the CLASS TRADE.

Swap ORDER_FILLING_FOK by ORDER_FILLING_IOC at the beginning of trade.mqh

In the trade.PositionOpen and trade.PositionClose functions append in all the following line after the DEVIATION

  "m_request.type_filling = (ORDER_FILLING_IOC);"

Just compile that the problem will be solved.


Who can solve, write your experience there


 

It's a bad idea. There is no bug in Trade.mqh so no reason to change it, it would be better to learn how to use it correctly.

You can do what you want, but I have to remove your file, sorry.

 
OK. no problem. my intention was just to help. it turns out that some brokers like XM and FX do not accept FOK order. so I made this modification that I solved and I've been using for a year. There are a lot of people with this problem. just search here in the forum.
 
Joao Luiz Sa Marchioro: OK. no problem. my intention was just to help. it turns out that some brokers like XM and FX do not accept FOK order. so I made this modification that I solved and I've been using for a year. There are a lot of people with this problem. just search here in the forum.

There is nothing to fix. You are the one that is not using the code properly. CTrade already has class methods for setting the filling type, so fix your EA and not the class (please read the documentation on the Standard Library):

SetTypeFilling

Sets filling type of the order.

void  SetTypeFilling(
   ENUM_ORDER_TYPE_FILLING  filling      // order filling type
   )

Parameters

filling

[in]  Order filling type from ENUM_ORDER_TYPE_FILLING enumeration.

Return Value

None.

SetTypeFillingBySymbol

Sets filling type of the order according to the specified symbol settings.

bool  SetTypeFillingBySymbol(
   const string   symbol      // symbol name
   )

Parameters

symbol

[in] Name of the symbol, in which SYMBOL_FILLING_MODE contains allowed order filling policies.

Return Value

true — successful execution, false — failed to define the filling policy.

Note

If SYMBOL_FILLING_FOK and SYMBOL_FILLING_IOC filling policies are allowed for a symbol simultaneously, the ORDER_FILLING_FOK value is set for the order.

 
Joao Luiz Sa Marchioro:
OK. no problem. my intention was just to help. it turns out that some brokers like XM and FX do not accept FOK order. so I made this modification that I solved and I've been using for a year. There are a lot of people with this problem. just search here in the forum.

Yes because there are a lot of people who don't understand what they are doing.

I already answered this question probably 10 times on this forum, without even counting all the other answers. 

Learn to search, learn what is a filling mode and understand it.

 

Thanks, I appreciate the help and I know that you are right, I am very weak and beginner in programming, however, I tried everything and could not resolve the use of the original Ctrade in this case or I did manually using "ordersend" or I changed the ctrade, I decided to change the ctrade, I confess it was not easy, but it was perfect, I made a copy of the ctrade and put the name of ctrade_IOC and use it in "include".

It would be interesting for you to test the ctrade in an XM DEMO account to better understand the problem.

There is a forum in Portuguese that opened on a colleague thanks for the help.

https://www.mql5.com/pt/forum/189682

For what is lay in programming, this solution is simple and helps a lot who is starting, is not the most correct, but is efficient.

PS: Alain, I researched a lot back then before solving my own order fulfillment problem, I saw many responses from you, alias, I always see you helping the team, thank you, however, in this case, no answer helped me I was forced to solve it and I confess it was difficult, so I will expose the solution I found here.

MT5 (UNSUPPORTED FILLING MODE)
MT5 (UNSUPPORTED FILLING MODE)
  • 2017.04.09
  • www.mql5.com
For personnel who are having problems filling out order in MT5 (UNSUPPORTED FILLING MODE) I was able to solve with the following changes within the...
 
Joao Luiz Sa Marchioro:

Thanks, I appreciate the help and I know that you are right, I am very weak and beginner in programming, however, I tried everything and could not resolve the use of the original Ctrade in this case or I did manually using "ordersend" or I changed the ctrade, I decided to change the ctrade, I confess it was not easy, but it was perfect, I made a copy of the ctrade and put the name of ctrade_IOC and use it in "include".

It would be interesting for you to test the ctrade in an XM DEMO account to better understand the problem.

There is a forum in Portuguese that opened on a colleague thanks for the help.

https://www.mql5.com/pt/forum/189682

For what is lay in programming, this solution is simple and helps a lot who is starting, is not the most correct, but is efficient.

PS: Alain, I researched a lot back then before solving my own order fulfillment problem, I saw many responses from you, alias, I always see you helping the team, thank you, however, in this case, no answer helped me I was forced to solve it and I confess it was difficult, so I will expose the solution I found here.

Yes but it's a solution for you, with your broker and your instrument, do you understand ? Of course if it's ok for your needs no problem, but it's not an help for people which are in other situations.

And if you still have a problem after searching, you can always ask for specific help (better mentioning you already searched otherwise I am not happy ;-). Just provide all the needed information.

It would be interesting for you to test the ctrade in an XM DEMO account to better understand the problem.

Do you mean XP broker ? I know very well how it works on demo and real account. And it's not the same as other broker like Rico or Modal.

 
Alain Verleyen:

It's a bad idea. There is no bug in Trade.mqh so no reason to change it, it would be better to learn how to use it correctly.

You can do what you want, but I have to remove your file, sorry.

 
Alain Verleyen:

Sim, mas é uma solução para você, com seu corretor e seu instrumento, você entende? Claro, se está certo para suas necessidades, não há problema, mas não é uma ajuda para as pessoas que estão em outras situações.

E se você ainda tiver um problema depois de pesquisar, você sempre pode pedir ajuda específica (melhor mencionar que você já pesquisou, caso contrário não estou feliz ;-). Apenas forneça todas as informações necessárias.

Você quer dizer corretor XP? Eu sei muito bem como funciona na demo e na conta real. E não é o mesmo que outro corretor como Rico ou Modal.

XM itself.

This problem only happens in XM and FX PRO in FOREX. In XP here in Brazil I have no problem.
Alain Verleyen:

Yes but it's a solution for you, with your broker and your instrument, do you understand ? Of course if it's ok for your needs no problem, but it's not an help for people which are in other situations.

And if you still have a problem after searching, you can always ask for specific help (better mentioning you already searched otherwise I am not happy ;-). Just provide all the needed information.

Do you mean XP broker ? I know very well how it works on demo and real account. And it's not the same as other broker like Rico or Modal.


MX itself.

This problem only happens in XM and FX PRO in FOREX. In XP here in Brazil I have no problem.

Reason: