if(Auxiliary.IsNewBar()) // Check every 5 minute ... { ulong start = GetMicrosecondCount(); VWMACD.Refresh_DataBuffer(); // Update all data buffers ulong finish = GetMicrosecondCount(); PrintFormat("Function %s in %s took %.1f ms",__FUNCTION__,__FILE__,(finish-start)/1000); //--- Implement trading operations of a strategy MACDCrossOOZ.Init_MACDCross_OoZ(); }
Looks like you never called the Refresh_DataBuffer() of your MACDCrossOOZ instance. VWMACD is an entirely different instance, of course they derive from the same base class, but won't share the data.
So all initializing that's done with VWMACD has also to be done with MACDCrossOOZ.
lippmaje:
Looks like you never called the Refresh_DataBuffer() of your MACDCrossOOZ instance. VWMACD is an entirely different instance, of course they derive from the same base class, but won't share the data.
So all initializing that's done with VWMACD has also to be done with MACDCrossOOZ.
Thanks lippmaje :)
yes it worked and I am not getting the error.

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
UPDATE NOTE: the issue is resolved ...
Dear Friends
I am trying to develop an EA, based on Strategy BaseClass for MACD and derived class MACD OsMA Cross.
When run VWMACD.Refresh_DataBuffer(); all the data are filled in the array(s).
However, when trying to run the "MACDCrossOOZ.Init_MACDCross_OoZ();" from derived class, array out of range error showed up. Checking with ArraySize() I noticed all my arrays get initialized to Zero Elements.
I have failed to find out why it is happening.
Also guide me, if this approach is reasonable for EA development.
Seeking support from the forum.
NOTE: code have been truncated for non-essential parts due to message size limitation.
2021.06.07 15:17:28.441 EA_MACDCross (US30,M5) MACDBase::Refresh_DataBuffer arraysize 11
2021.06.07 15:17:28.441 EA_MACDCross (US30,M5) Function OnTick in EA_MACDCross.mq5 took 101.0 ms
2021.06.07 15:17:28.441 EA_MACDCross (US30,M5) MACDBase::Set_FEPoint_LONG arraysize 0
2021.06.07 15:17:28.441 EA_MACDCross (US30,M5) array out of range in 'MACDBase.mqh' (332,17)