Does the message "OnInit the variable 'pIndTimeSer' isn't initialized!" appear when you execute your code? I think It would have been nice if you had exited from OnInit function with result not equal 0.
Have you implemented check for POINTER_INVALID before using pointer on the line 151?
It is very difficult to give you any helpful advice before you show the full source of your EA.
See also the article Using the Object Pointers in MQL5
Does the message "OnInit the variable 'pIndTimeSer' isn't initialized!" appear when you execute your code? I think It would have been nice if you had exited from OnInit function with result not equal 0.
Have you implemented check for POINTER_INVALID before using pointer on the line 151?
It is very difficult to give you any helpful advice before you show the full source of your EA.
here is the code for my EA - its just the OnInit() as I was trying to see if the signal class will be compiled and will run.
I've implemented POINTER_INVALID check before line 151; the pointeris fine and the error remains
#include <..\Libraries\cisnewbar.mqh> //source mql5.com #include <Signal\MySignals\SampleSignal.mqh> //class signals for MA and for implementing strategy #include <onnewbar.mqh> //on new bar event handler #include <k_orders.mqh> //the order class for executing orders //+------------------------------------------------------------------+ //| Our signals object to handle the trades | //+------------------------------------------------------------------+ //CIndicators* pIndTimeSer; CIndicators* pIndTimeSer;// = new CIndicators(); CSampleSignal oSignal; MqlTradeRequest sTradeReq;//temporary store parameters of a trade double iccaVal[]; //this holds the logical value for the controller class Order objOrder; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- create timer EventSetTimer(60); pIndTimeSer = new CIndicators(); //check the pointer: if(CheckPointer(pIndTimeSer)==POINTER_INVALID) Print(__FUNCTION__," the variable 'pIndTimeSer' isn't initialized!"); oSignal.ValidationSettings(); oSignal.InitIndicators(pIndTimeSer); //init trade to use in Signal //--- return(0); }
the following pointer m_symbol is not initialized:
if(CheckPointer(m_symbol)==POINTER_INVALID) Print(__FUNCTION__," the variable 'm_symbol' isn't initialized!"); if(!m_MA.Create(m_symbol.Name(),m_period,m_period_ma,m_shift_ma,m_method_ma,m_applied_ma
produces the error invalid pointer:
2011.11.21 21:29:39 Core 1 2011.10.01 00:00:00 CSampleSignal::InitMA the variable 'm_symbol' isn't initialized!
...
- www.mql5.com
the following pointer m_symbol is not initialized:
produces the error invalid pointer:
2011.11.21 21:29:39 Core 1 2011.10.01 00:00:00 CSampleSignal::InitMA the variable 'm_symbol' isn't initialized!
...
Could you provide a full source?
I need to see where and how you are initializing your object.
Please do not forget to provide all includes and libraries.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I wanted to play with the example from
MQL5 Wizard: How to Create a Module of Trading Signals
https://www.mql5.com/en/articles/226
and wanted to implement it in my own EA; unfortunately I get the invalid pointer access in 'SampleSignal.mqh' (151,20) in the file
samplesignal.mqh
the code from my EA using the samplesignal.mqh is:
still cannot resolve the error...any suggestions are welcome!