Time[-1]

 
I know Time[-1] is invalid, but you know what I mean. How do I get the time of the next bar? Or Time[-10], Time[-100]?
 
Time[0]+n*Period()
 
DxdCn:
Time[0]+n*Period()
* 60 . . . time is in seconds, Period() is in minutes.
 
jesuscheung:
I know Time[-1] is invalid, but you know what I mean. How do I get the time of the next bar? Or Time[-10], Time[-100]?

Wrong, it is valid. It's esp. useful for chartwork in "future" mode. Reference below.


 

YOU ARE WRONG

Print(TimeToStr(Time[-1]));

this is what I get:

2011.10.20 20:25:14 test GBPUSD,Daily: 1970.01.01 00:00

 

By the way, don't be retarded, that chart is done by shifiting

I want the time of Time[-1]

Time[0]+n*Period() DOESNT WORK

there are Sunday and Saturday, those days can have no bars.

 
jesuscheung:

By the way, don't be retarded, that chart is done by shifiting

I want the time of Time[-1]

Time[0]+n*Period() DOESNT WORK

there are Sunday and Saturday, those days can have no bars.

Read my last post . . . if you want to take account of Saturday and Sunday then you have to take account of them in your code.
 
jesuscheung:

By the way, don't be retarded, that chart is done by shifiting

I want the time of Time[-1]

Time[0]+n*Period() DOESNT WORK

there are Sunday and Saturday, those days can have no bars.

(1) No. that is not a chart. It is an indicator.

(2) No. it is not done by shifting.

(3) DO NOT USE & ABUSE THE NAME JESUS, if "retarded" is what you easily use upon others.

I may be wrong with you, BUT YOU ARE WRONG WITH YOURSELF, OTHERS & JESUS.

 

just admit you are wrong... RETARD... LOL... you cannot explain:

Print(TimeToStr(Time[-1]));

test GBPUSD,Daily: 1970.01.01 00:00

 
I love it when people attack me personally because they are losing an logical argument
 

2011.10.21 11:32:

int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   Print(TimeToStr(Time[0])," ",TimeToStr(Time[0]+10*Period()*60));
//----
   return(0);
  }

result:   AUDUSD,M1: 2011.10.21 06:01 2011.10.21 06:11

Reason: