I am realy BIG stupid...?

 
            CurrBars=iBars(Symbols[i],tf[j]);
            
            if(PreBars!=CurrBars) {
               k=0;
               if (Time[CurrBars-10]<StrToTime("2011.12.12") ) 
               { Print ("break ",Symbols[i]," Timeframe ",tf[j], " ",TimeToStr(Time[CurrBars-10], TIME_DATE|TIME_MINUTES));  
                 Print("time curr:" ,Time[CurrBars-10]," ",CurrBars, "time curr:", StrToTime("2012.1.12") ); 
                 break;
               } 
               else
                 Print (l," ",Symbols[i]," Timeframe ",tf[j], " ",TimeToStr(Time[CurrBars-1], TIME_DATE|TIME_MINUTES));  

Hi,

help me, please. My part code is:

Count bar is higher than zero (variable CurrBars), command Time[CurrBars-10] return ZERO .... ??? Why? I am realy stupid?

obr. from terminal:

 
Time[CurrBars-10]
datetime past_time=iTime(Symbol(),TF,10);     //TF  0,1,5,15,30,60,240......  

And

StrToTime("2012.1.12")

datetime   sometime                   = D'2012.01.12 00:00';// 12 jan 2012
Learn to use datetime
 
deVries:
Time[CurrBars-10]

this is not an equivalent . . .

datetime past_time=iTime(Symbol(),TF,10);     //TF  0,1,5,15,30,60,240......  

your past_time is the time for bar 10, the OP wants the time for the leftmost bar-10 bars, so 10 bars from the left.

This would be a correct alternative . . .

datetime past_time=iTime(Symbol(),TF,CurrBars-10);     //TF  0,1,5,15,30,60,240......  

The question is why does the OP's code fail . . . I don't see anything obvious.

 
Time[CurrBars+10]
 
qjol:
Time[CurrBars+10]

Nope . . .

CurrBars=iBars(Symbols[i],tf[j]);

iBars "Returns the number of bars on the specified chart."

 
endy5:
Count bar is higher than zero (variable CurrBars), command Time[CurrBars-10] return ZERO .... ??? Why? I am realy stupid?

Because Time[-1] is in the FUTURE.
 

if Bars(on chart) < CurrBars-10 Time[CurrBars-10] = 0

 
Thanks all. Error was using function Time[]. Valid function is iTime[]
 
endy5:
Thanks all. Error was using function Time[]. Valid function is iTime[]
Ah . . . of course, when you are working with symbols other than the chart where the EA is attached.
Reason: