BUG

 

MT4, the official website of the old ZIGZAG MT4 indicators, there is a piece of code (excerpt part of the code segment), IndicatorCounted () function on the start () inside.I used to debug the test and found a very strange phenomenon.

 case 1: If  added breakpoint 1 and breakpoint 2,  start () first run, IndicatorCounted () = 0; start () the second run,  IndicatorCounted () = Bars-1; start () when running third and subsequent times, IndicatorCounted () = Bars-1

Case 2: If added breakpoint 1, remove the breakpoint 2, start () first run, IndicatorCounted () =0; start () the second run, IndicatorCounted () = 0; start () when running third and subsequent times, IndicatorCounted () = Bars-1

Only changes the breakpoint, not any change program code, why debug of how the different results? 

int start ()

{

Breakpoint 1 int i, counted_bars = IndicatorCounted ();

Breakpoint 2 int limit, counterZ, whatlookfor;

int shift, back, lasthighpos, lastlowpos;

double val, res;

double curlow, curhigh, lasthigh, lastlow;

if (counted_bars == 0 && downloadhistory)  

{

ArrayInitialize (ZigzagBuffer, 0.0);

ArrayInitialize (HighMapBuffer, 0.0);

ArrayInitialize (LowMapBuffer, 0.0);

}

if (counted_bars == 0)

{

limit = Bars-ExtDepth;

downloadhistory = true;

}

Slightly. . . . .


 
1648401654c:

MT4, the official website of the old ZIGZAG MT4 indicators, there is a piece of code (excerpt part of the code segment), IndicatorCounted () function on the start () inside.I used to debug the test and found a very strange phenomenon.

Slightly. . . . .

Hello, please post MQL4-related questions on the MQL4 forum.
MQL4: automated trading forum
  • www.mql5.com
MQL4: automated trading forum