FillingCheck doesn't pass

 

Hi there

I've downloaded ma_cross.mqh and testma_cross.mq5 from "Create Your Own Trading Robot in 6 Steps!" https://www.mql5.com/en/articles/367.

I checked the Expert Advisor in the Tester for EURUSD on daily TF between 2014.09.01 and 2015.04.15 and I had no trades because of Trade class doesn't pass FillingCheck.

I checked the values filling=2 and  m_type_filling=0, in market watch  EURUSD specification has Fillig "Immediate or Cancel".

How can I solve?


Nicola Grippaldi
Metatrader 5 - Version 5.0 - Buil 1100

 

Putting

CTrade::CTrade(void) : m_async_mode(false),
                       m_magic(0),
                       m_deviation(10),
                       m_type_filling(ORDER_FILLING_IOC),
                       m_log_level(LOG_LEVEL_ERRORS)

the test gained trades according to MA crosses, but I don't understand how to control m_type_filling from EA code

thanks

Nicola

 
Nicola Grippaldi:

Putting

the test gained trades according to MA crosses, but I don't understand how to control m_type_filling from EA code

thanks

Nicola

I fear it's not possible directly. You have to create your own class derived from CExpert and overload the InitTrade() method.
 

I agree, but why should I control order filling than assume symbol filling? Mt5 doesn't. Seems a design divergence.

Thanks anyway.

 
Nicola Grippaldi:

I agree, but why should I control order filling than assume symbol filling? Mt5 doesn't. Seems a design divergence.

Thanks anyway.

It's perfectly normal to control the order filling type, it's a trader decision. Some symbols allow only one filling, but most of time you have the choice.
 
Alain Verleyen:
It's perfectly normal to control the order filling type, it's a trader decision. Some symbols allow only one filling, but most of time you have the choice.
thank you very much