I am a self taught mql4 hack needing a bit of assistance to get a complex (to me anyway) data type defined - and have been trying for several nights. A bit of help would be greatly appreciated. I am writing an EA to apply a trading methodology that uses a combination of M1, M5 and M15 time frames. The EA is written for M1 charts - but keeps tabs on what the indicators in M5 and M15 charts would look like. Each time frame is represented in a Dynamic Array of Pointers to Class objects (CEvents).
CEvents *ptr = new CEvents(); // create the class object,
M1PtrArray.Append(ptr); // Append this to the correct array (could be any combination of M1, M5 and M15)
My challenge is that the Initialise() method needs to reference properties in the previous CEvent in the same array and this is not accessible unless I pass a reference to the array. I am struggling to correct define this ...? A bit beyond my depth.
Would greatly appreciate the insight I am missing.
Have attached a minimal version with the issues exposed (does not compile) .
Thank you in advance,
I had rules out passing the pointer to the previous element as the class library does not know which Array it was working with. However as you have correctly pointed out - that does not actually matter ;~)
Thanks you for taking the time to respond. I will keep you in the loop on the results of the bot ;) Initial forward results are very promising.