How to set or change TrendType or type_filling to IOC instead FOK

 

Hi

 

I want set de Cexpert class to use type trend some times as Fill or Kill (FOK) that is default in Expert Advisor generator, but

also want use some times as  ORDER_FILLING_IOC (IOC)

I tryed set trailing.TrendType(ORDER_FILLING_IOC); //enum_type_trend

but didn't work.

also, How can I set some equivalent to request.type_filling=ORDER_FILLING_IOC;

Please some advise

Thanks in advance.

Elton Spode 

 

You have to create your own CExpertTrade object, initialize it, then pass it to the CExpert object with :

myExpert.InitTrade(magic,myTrade);
 

Thank you  Alain.

 

I modify the code generated as described below, and now the expert is sending orders to my broker.

input ENUM_ORDER_TYPE_FILLING Trade_Type_Filling  =ORDER_FILLING_IOC; //Trade Type Filling (FOK,IOC, Return)
//...

//--- Creating Trade
CExpertTrade *myTrade=new CExpertTrade;

   if(myTrade==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating trade");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//ORDER_FILLING_FOK
//ORDER_FILLING_IOC
//ORDER_FILLING_RETURN

myTrade.SetTypeFilling(Trade_Type_Filling);
ExtExpert.InitTrade(Expert_MagicNumber,myTrade);