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);
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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