1648401654c:
Hello, please post MQL4-related questions on the MQL4 forum.
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. . . . .
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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. . . . .