Experts: Opening and Сlosing on time - page 2

 
Alain Verleyen:

You don't check/set the filling type in your code. That's why it's not working on FxPro-ECN.

And as you don't check trade operation returned value, it does trade silently. 

Looks like you were right: in FxPro-ECN server

2017.01.25 20:52:52.321 Core 1  2017.01.24 13:00:00   Buy -> false. Result Retcode: 10030, description of result: invalid fill


This is some strange broker.

 

Version 1.1002:

   m_trade.SetExpertMagicNumber(m_magic);
//---
   if(IsFillingTypeAllowed(Symbol(),SYMBOL_FILLING_IOC))
      m_trade.SetTypeFilling(ORDER_FILLING_IOC);
//---
   return(INIT_SUCCEEDED);
  }
Now on FxPRO-ECN of the transaction open
 
Vladimir Karputov:

Looks like you were right: in FxPro-ECN server

2017.01.25 20:52:52.321 Core 1  2017.01.24 13:00:00   Buy -> false. Result Retcode: 10030, description of result: invalid fill


This is some strange broker.

Yes it gives me the same error with your new version now

 


 So whats the sulution?

Change brokers? 

 
Vladimir Karputov:

Version 1.1002:

   m_trade.SetExpertMagicNumber(m_magic);
//---
   if(IsFillingTypeAllowed(Symbol(),SYMBOL_FILLING_IOC))
      m_trade.SetTypeFilling(ORDER_FILLING_IOC);
//---
   return(INIT_SUCCEEDED);
  }
Now on FxPRO-ECN of the transaction open
Yes it works now with FxPro-ECN Thank you verry much Vladimir and Alain
 
tigerclaw:
Yes it works now with FxPro-ECN Thank you verry much Vladimir and Alain
Positions are closed correctly (version 1.102)?
Reason: