Discussion of article "The power of ZigZag (part I). Developing the base class of the indicator" - page 7

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
Downloaded a new archive, tried to compile TestZZ_03.mq5
The result is the same. Error and reference to the same function initiated twice with different parameters.
Show the code of the CZigZagModule::GetZigZagData() method, in which buffer numbers should be passed.
Show the code of the CZigZagModule::GetZigZagData() method, where you need to pass buffer numbers.
void CZigZagModule::GetZigZagData(const double &zz_h[],const double &zz_l[],const datetime &time[])
{
int h_total =::ArraySize(zz_h);
int l_total =::ArraySize(zz_l);
int total =h_total+l_total;
//--- Zero ZZ variables
ZeroZigZagData();
//--- Let's loop through the copied ZZ values
for(int i=0; i<total; i++)
{
//--- If we have already obtained the required number of ZZ maxima and minima, exit the loop
if(m_counter_highs==m_copy_extremums && m_counter_lows==m_copy_extremums)
break;
//--- Control of array overrun
if(i>=h_total || i>=l_total)
break;
//--- Fill the array of maxima until the required number is copied
if(zz_h[i]>0 && m_counter_highs<m_copy_extremums)
{
m_zz_high[m_counter_highs] =zz_h[i];
m_zz_high_bar[m_counter_highs] =i;
m_zz_high_time[m_counter_highs] =time[i];
//--- Increase the highs counter
m_counter_highs++;
}
//--- Fill the minimums array until we have copied the required number of minimums
if(zz_l[i]>0 && m_counter_lows<m_copy_extremums)
{
m_zz_low[m_counter_lows] =zz_l[i];
m_zz_low_bar[m_counter_lows] =i;
m_zz_low_time[m_counter_lows] =time[i];
//--- Increase the count of minima
m_counter_lows++;
}
}
TestZZZ_03 and TestZZZ_04 do not appear among the uploaded Expert Advisors, so TestZZ_04 is not compiled either.
Then try to figure out why they don't appear. I have looked through the archive again. Everything for tests is there.
Show the code of the CZigZagModule::GetZigZagData() method, to which you need to pass buffer numbers.
void CZigZagModule::GetZigZagData(const int handle,int buffer_num_highs,int buffer_num_lows,
const string symbol,const ENUM_TIMEFRAMES period,
const datetime start_time,const datetime stop_time)
{
//--- Let's get the initial data
int times_total =::CopyTime(symbol,period,start_time,stop_time,m_zz_time_temp);
int highs_total =::CopyBuffer(handle,2,0,times_total,m_zz_highs_temp);
int lows_total =::CopyBuffer(handle,3,0,times_total,m_zz_lows_temp);
//--- Maximum number of extrema
int max_items =(int)::fmax((double)highs_total,(double)lows_total);
//--- If it is not enough, let's try again
if(times_total<max_items)
{
while(true)
{
::Sleep(100);
times_total=::CopyTime(symbol,period,start_time,stop_time,m_zz_time_temp);
if(times_total>=max_items)
break;
}
}
//--- Counters
int lows_counter =0;
int highs_counter =0;
//--- Counting highs
int h_total=::ArraySize(m_zz_highs_temp);
for(int i=0; i<h_total; i++)
{
if(m_zz_highs_temp[i]>0)
highs_counter++;
}
//--- Count the minima
int l_total=::ArraySize(m_zz_lows_temp);
for(int i=0; i<l_total; i++)
{
if(m_zz_lows_temp[i]>0)
lows_counter++;
}
//--- Get the number of extrema
int copy_extremums=(int)::fmin((double)highs_counter,(double)lows_counter);
CopyExtremums(copy_extremums);
//--- Let's loop through the copied ZZ values
GetZigZagData(m_zz_highs_temp,m_zz_lows_temp,m_zz_time_temp);
}
...
Insert the code correctly:
//---
This is the wrong method. This is the one with this list of parameters:
Both methods are written in an inline file.
First page 217.
Second p 258
...
You didn't replace the files. Delete them all. And re-download from the last archive: https: //www.mql5.com/ru/forum/299970/page6#comment_10495849