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 2012Learn to use datetime
deVries:
Time[CurrBars-10]
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]
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?
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
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.
Thanks all. Error was using function Time[]. Valid function is iTime[]

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
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: