MQL5 Read function value from class

To add comments, please log in or register
FiaMeta5admiral
964
FiaMeta5admiral  
How to read value of the function CheckPatternAllBullish() in class  CCandlePattern ?

I want to read it inside in void OnTick()

// Print(fican.CheckPatternAllBullish());

Error is  invalid pointer access in 'candlepatterns.mqh' (162,20)

Thanks!

//+------------------------------------------------------------------+

//| Include                                                          | //+------------------------------------------------------------------+ #include <Expert\Expert.mqh> #include <candlepatterns.mqh> ulong                    Expert_MagicNumber        =3434;        // bool                     Expert_EveryTick          =false;       // //+------------------------------------------------------------------+ //| Global expert object                                             | //+------------------------------------------------------------------+ CExpert ExtExpert; CCandlePattern fican; //+------------------------------------------------------------------+ //| Initialization function of the expert                            | //+------------------------------------------------------------------+ int OnInit(){    if(!ExtExpert.Init(Symbol(),Period(),Expert_EveryTick,Expert_MagicNumber)) {//--- failed       printf(__FUNCTION__+": error initializing expert");   ExtExpert.Deinit();   return(INIT_FAILED);  } //--- Creating signal    CExpertSignal *signal = new CExpertSignal;    if(signal==NULL){                printf(__FUNCTION__+": error creating signal"); ExtExpert.Deinit();   return(INIT_FAILED);  }    ExtExpert.InitSignal(signal);       CIndicators *indicators = new  CIndicators;    if(indicators==NULL){                printf(__FUNCTION__+": IND NIJE dignut signal"); ExtExpert.Deinit();   return(INIT_FAILED);  }    //ExtExpert.InitIndicators(indicators);       //--- Creating filter CMySignalEnvelopes    //CMySignalEnvelopes *filter0=new CMySignalEnvelopes;    CCandlePattern *filter0 = new CCandlePattern;          if(filter0==NULL){               printf(__FUNCTION__+": error creating filter0");  ExtExpert.Deinit();  return(INIT_FAILED); }    filter0.MAPeriod(22);         //--- Tuning of all necessary indicators    if(!ExtExpert.InitIndicators()){  printf(__FUNCTION__+": error initializing indicators"); ExtExpert.Deinit();  return(INIT_FAILED); }       if(!filter0.InitIndicators(indicators)){  printf(__FUNCTION__+": error initializing CC "); ExtExpert.Deinit();  return(INIT_FAILED); }    filter0.ValidationSettings();    filter0.InitSignal(signal);           signal.AddFilter(filter0);   //--- Set filter parameters       return(INIT_SUCCEEDED);   } //+------------------------------------------------------------------+ //| "Tick" event handler function                                    | //+------------------------------------------------------------------+ void OnTick(){    ExtExpert.OnTick(); // fican.InitIndicators(indicators);    fican.CheckPatternAllBullish();   // Print(fican.CheckPatternAllBullish());    Print("Read price "+ExtExpert.Low(0)+" O1 "+ExtExpert.Open(1)+" C1 "+ExtExpert.Close(1)+" O2 "+ExtExpert.Open(2));   }
Fernando Carreiro
4461
Fernando Carreiro  
FiaMeta5admiral:

Error is  invalid pointer access in 'candlepatterns.mqh' (162,20)

Since the the error is reported at Line 162, Character 20 of the file "candlepatterns.mqh", you will need to provide that include file, or in the very least, that section of the code, for analysis.

FiaMeta5admiral
964
FiaMeta5admiral  

Here's the file

Files:
To add comments, please log in or register