Error when Debugging EA Installed Standard with Metaeditor

 

The attached file, ExpertMAPSARSizeOptimized, came standard with MetaEditor.

It is in the Expert/Advisors folder. While debugging I noticed there were errors in the Trend.mqh file, lines 812 to 815.

//--- create
   m_handle=iMA(symbol,period,ma_period,ma_shift,ma_method,applied);
//--- check result
   if(m_handle==INVALID_HANDLE)
      return(false);

Has anyone had a similar experience? I also debugged another Expert Advisor generated from the Wizard and placed the breakpoint in the OnTick event handler.

It did not pause at the breakpoint. I noticed it paused at the breakpoint when it is placed in OnInit.

I soon realize that in the case of the breakpoint in OnTick, the program had terminated before it got to the breakpoint.

In tracing the program, the exit point was inside one of the derived class which is in the Standard library.

Any ideas, I am studying these libraries and am reluctant to make changes.

Documentation on MQL5: Standard Library
Documentation on MQL5: Standard Library
  • www.mql5.com
Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Devon McKenzie :


What confuses you in this code?

//--- create
   m_handle=iMA(symbol,period,ma_period,ma_shift,ma_method,applied);
//--- check result
   if(m_handle==INVALID_HANDLE)
      return(false);

Everything is correct: the correctness of the created handle is checked, and if the handle was not created, then there is an error.

 
Devon McKenzie:

The attached file, ExpertMAPSARSizeOptimized, came standard with MetaEditor.

It is in the Expert/Advisors folder. While debugging I noticed there were errors in the Trend.mqh file, lines 812 to 815.

Has anyone had a similar experience? I also debugged another Expert Advisor generated from the Wizard and placed the breakpoint in the OnTick event handler.

It did not pause at the breakpoint. I noticed it paused at the breakpoint when it is placed in OnInit.

I soon realize that in the case of the breakpoint in OnTick, the program had terminated before it got to the breakpoint.

In tracing the program, the exit point was inside one of the derived class which is in the Standard library.

Any ideas, I am studying these libraries and am reluctant to make changes.

There is no problem with this code.

Tested with build 2981 (production release) and 3036 (last beta).