getting init failed on this code New comment n22alpha 2015.07.12 15:14 Hi guys I seem to be getting init failed when I try this code could someone help me?? thanks alot.int OnInit(void) { //--- Initializing expert if(!ExtExpert.Init(Symbol(),LowerTime,Expert_EveryTick,Expert_MagicNumber)) { //--- failed printf(__FUNCTION__+": error initializing expert"); ExtExpert.Deinit(); return(-1); } //--- Creation of signal object //--- set MagicNumber for your orders identification trd.SetExpertMagicNumber(Expert_MagicNumber); trd.SetDeviationInPoints(slippage); //--- order filling mode, the mode allowed by the server should be used trd.SetTypeFilling(ORDER_FILLING_RETURN); //--- what function is to be used for trading: true - OrderSendAsync(), false - OrderSend() //trade.SetAsyncMode(true); if(bol_bands_ht==NULL || _ma_ht == NULL || bol_bands_lt==NULL || _ma_lt == NULL) { //--- failed Print("Error creating signal."); return(-2); } bool bolcreate = bol_bands_ht.Create(Symbol(),HigherTime, Bol_Period, 0, Bol_Dev, PRICE_CLOSE); bool macreate = _ma_ht.Create(Symbol(), Period(), MA_period, 0, MODE_EMA, PRICE_CLOSE); bool bolcreate_two = bol_bands_lt.Create(Symbol(),LowerTime, Bol_Period, 0, Bol_Dev, PRICE_CLOSE); bool macreate_two = _ma_lt.Create(Symbol(), LowerTime, MA_period, 0, MODE_EMA, PRICE_CLOSE); if (!bolcreate || !macreate || !bolcreate_two || !macreate_two) { Print("Error creating indicator."); return(-3); } _ma_ht.AddToChart(1,0); bol_bands_ht.AddToChart(1,0); _ma_lt.AddToChart(0,0); bol_bands_lt.AddToChart(0,0); //--- succeed return(INIT_SUCCEEDED); } Discussion of article "General information on Trading Signals for MetaTrader 4 and MetaTrader 5" Angle indicator keeps returning 0.000 copybuffer for bollinger bands JD4 2015.07.12 21:22 #1 Check this page and this page out. You can tell the program to let you know what failed. New comment
Hi guys I seem to be getting init failed when I try this code could someone help me?? thanks alot.