MqlDateTime str1;
MqlRates rates[];
int copy_rates=0;
bool begin=false;
double High1=0.0;
double Low1=10000.0;
int day=32;
for(int r=0; r<=62; r++)
{
copy_rates=CopyRates(_Symbol,PERIOD_D1,r,1,rates);
if(copy_rates<1) {Print("Ошибка копирования данных"); break;}
TimeToStruct(rates[0].time,str1);
if(day>str1.day && !begin) {day=str1.day; continue;}
if(day<str1.day && !begin) {day=32; begin=true;}
if(begin)
{
if(day>str1.day) day=str1.day;
else {begin=false; break;}
if(High1<rates[0].high) High1=rates[0].high;
if(Low1>rates[0].low) Low1=rates[0].low;
}
}
Print("High= ",iHigh(_Symbol,PERIOD_MN1,1));
Print("High1=",High1);
Print("Low= ",iLow(_Symbol,PERIOD_MN1,1));
Print("Low1=",Low1);
if(iHigh(_Symbol,PERIOD_MN1,1)!=High1) Print(iHigh(_Symbol,PERIOD_MN1,1)," High ",High1);
if(iLow(_Symbol,PERIOD_MN1,1)!=Low1) Print(iLow(_Symbol,PERIOD_MN1,1)," Low ",Low1);