Download MetaTrader 5

FillingCheck doesn't pass

To add comments, please log in or register
No time to learn MQL5? Order your application from a developer!
Nicola Grippaldi
71
Nicola Grippaldi 2015.05.28 21:36 

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

Nicola Grippaldi
71
Nicola Grippaldi 2015.05.30 05:18  

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

Alain Verleyen
Moderator
30712
Alain Verleyen 2015.05.30 10:10  
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.
Nicola Grippaldi
71
Nicola Grippaldi 2015.05.30 10:30  

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

Thanks anyway.

Alain Verleyen
Moderator
30712
Alain Verleyen 2015.05.30 10:47  
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.
Nicola Grippaldi
71
Nicola Grippaldi 2015.05.30 11:05  
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
To add comments, please log in or register