Irregular function calling

 

Have any of you guys noticed any irregular function calling in MT5?

 

I have a simple pivots indicator which I've ported accross and I have a function which clears the pivot levels which are essentially trendline objects. The clear levels function is only called from OnDenit() and Oninit().

 

However the function is being entered after my DrawPivots() function on a random basis. This happens when I am switching timeframes.

 

So flow is: timeframe is changes - OnInit is called - Clear levels is called - Draw Pivots is called - Flow is returned to OnInit which should then exit and wait for tick data prior to calling OnCalculate.

 

BUT - Clear Levels () is somehow being called again after the Draw Pivots function. Not every time - just occasionally. Mind ****! 

 

I have put debug code (print statements) in the modules to monitor program flow and there is no doubt that the flow is onconsistent.

 

Anyone having any similar issues?

 

Have to say the MT4-MT5 migration is not straight forward. It's not going to be much of a crowd pleaser for all the folk with well established MT4 EAs and Indicators.

 

Port I must but with crappy bugs like this - it makes the whole process a great deal harder in terms of debugging. 

Documentation on MQL5: Language Basics / Functions / Event Handling Functions
  • www.mql5.com
Language Basics / Functions / Event Handling Functions - Documentation on MQL5
Reason: