Download MetaTrader 5

EA fails to open trades in Strategy Tester - CTrade::PositionOpen: [invalid fill]

To add comments, please log in or register
Articles can help you to solidify your knowledge. Come and read them!
johhny6
130
johhny6 2011.08.22 01:01 

None of the EA's (or my custom EA's) orders seem to be filled during strategy testing, returning this error every time:

2011.06.10 14:07:48 Core 1 2011.06.08 11:04:35 CTrade::PositionOpen: market buy 0.10 EURUSD tp: 1.47127 [invalid fill]


Has anyone seen this? Is it a broker-data problem?

The history is there (as it can see), but no orders are filled...

Is it a volume/slippage issue?


its similar to another persons experience, as linked below.

http://forums.babypips.com/newbie-island/39316-strategy-tester.html


thanks

Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Types of Chart Events
  • www.mql5.com
Standard Constants, Enumerations and Structures / Chart Constants / Types of Chart Events - Documentation on MQL5
Jimmy
490
Jimmy 2011.08.22 11:49  
johhny6:

None of the EA's (or my custom EA's) orders seem to be filled during strategy testing, returning this error every time:

2011.06.10 14:07:48 Core 1 2011.06.08 11:04:35 CTrade::PositionOpen: market buy 0.10 EURUSD tp: 1.47127 [invalid fill]


Has anyone seen this? Is it a broker-data problem?

The history is there (as it can see), but no orders are filled...

Is it a volume/slippage issue?


its similar to another persons experience, as linked below.

http://forums.babypips.com/newbie-island/39316-strategy-tester.html


thanks

Did you use SetTypeFilling method? Proabably better leave it w/ the default value.
johhny6
130
johhny6 2011.08.26 23:09  
fireflies:
Did you use SetTypeFilling method? Proabably better leave it w/ the default value.


thanks for that!

i'm now setting the type and a slippage .. which is working, cheers

            trade.SetTypeFilling(ORDER_FILLING_CANCEL); // AON
            trade.SetDeviationInPoints(Slippage);

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
Vos77
169
Vos77 2011.09.05 06:00  

Hey,

 none of my EAs work, all say Invalid fill in the journal,

 I don't understand the solution above, could someone please explain in simple terms?

Cheers. 

Jimmy
490
Jimmy 2011.09.05 16:07  
Vos77:

Hey,

 none of my EAs work, all say Invalid fill in the journal,

 I don't understand the solution above, could someone please explain in simple terms?

Cheers. 

Do you use OrderSend command in your EA to send the order? If you check the documentation, it uses MqlTradeRequest structure as input parameter to accept the order information.

One field in the structure, type_filling, determines how the order will be filled: all or nothing (ORDER_FILLING_AON), fill as many as allowed and cancel the rest (ORDER_FILLING_CANCEL), or fill as many as allowed and create a new order for the rest (ORDER_FILLING_RETURN).

The default value for this field is ORDER_FILLING_AON. Changing this default value may or may not create the invalid fill error (probably depends on the broker's setting).

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
johhny6
130
johhny6 2012.03.17 12:04  
Vos77:

Hey,

 none of my EAs work, all say Invalid fill in the journal,

 I don't understand the solution above, could someone please explain in simple terms?

Cheers. 


you need to adjust your EA to have a filling type, and set a slippage or deviation value.

i dont know what your EA is using for the trade class, but in the below example its just "trade".


   trade.SetTypeFilling(ORDER_FILLING_CANCEL);
   trade.SetDeviationInPoints(8);

To add comments, please log in or register