Current version: 4.85
- Minor bug fixes
Added/extended features
Current version: 4.3
Change-Log 4.3
Change-Log 1.06
Defines macros for supporting debugging code.
Supports following features:
All addons are freely configurable. All code inclusions have been done in preprocessor macros.
There is one known caveat within the definition of macros. The macro NULL does not work on preprocessor level, so it needs to be replaced. To work around the issue, you should cast the NULL makro like this: (double)NULL - Depending on the type being in use... string, int and so on...
Of course, the code is not fully complete and an assert usually includes a "try catch" but as they are not available, other techniques needed to be found to achieve at about a comparable result. Breakpoints will halt the code at that line, while you are debugging, pressing the F9-Key will make the debugger break into this exact location within the code. As close as possible, not the original.
All needed documentation is included in the header file.
All macros are optional, so the code below shows some of available macros. A full list and detailed description is included in the header file.
Example journal output:
#define LIB_DEBUG #include <mqlplus/lib_debug.mqh> //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ ///////////////////////////////////// // Function debug trace code #ifdef DBG_TRACE_ONINIT #undef DBG_TRACE_ONINIT #define DBG_TRACE_ONINIT(x) x #define DBG_TRACE_ONINIT_RETURN(x) DBG_MSG_TRACE_RETURN_VAR(x) #else #define DBG_TRACE_ONINIT(x) #define DBG_TRACE_ONINIT_RETURN(x) DBG_MSG_NOTRACE_RETURN_VAR(x) #endif ///////////////////////////////////// int OnInit() { DBG_TRACE_ONINIT( DBG_MSG_TRACE_BEGIN; ); PERF_COUNTER_BEGIN; //--- int test = NULL; DBG_MSG_VAR(test); //--- DBG_TRACE_ONINIT_RETURN(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ ///////////////////////////////////// // Function debug trace code #ifdef DBG_TRACE_ONDEINIT #undef DBG_TRACE_ONDEINIT #define DBG_TRACE_ONDEINIT(x) x #define DBG_TRACE_ONDEINIT_RETURN DBG_MSG_TRACE_RETURN #else #define DBG_TRACE_ONDEINIT(x) #define DBG_TRACE_ONDEINIT_RETURN DBG_MSG_NOTRACE_RETURN #endif ///////////////////////////////////// void OnDeinit(const int reason) { DBG_TRACE_ONDEINIT( DBG_MSG_TRACE_BEGIN; DBG_MSG_VAR(reason); ); PERF_COUNTER_BEGIN; //--- int test = NULL; DBG_MSG_VAR(test); DBG_TRACE_ONDEINIT_RETURN; } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- int test = NULL; DBG_MSG_VAR(test); return; } //+------------------------------------------------------------------+
Get all your Deal, Positions and order Information to .csv Files. Ready for Excel import
Wilson Relative Price Channel - modifiziert
An (optional) include file to enhance error code handling experience.
Extended version of the original Heikin Ashi indicator