Problem with Time[ 0 ] - it is constant !

[Deleted]  

Hello Forum,


Working with Time[ 0 ] I get a constant number.

I would like to have the begin time of a bar !

Please, why does the attached indicator show me a constant number (horizontal line) ?

How to get a time based rising line ?


Thanks a lot

Ulrich


#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red

double buffer[];

int init()
{ IndicatorShortName( "Time" );
IndicatorBuffers( 1 );
SetIndexBuffer( 0, buffer );
SetIndexShift( 0, 0 );
SetIndexStyle( 0, DRAW_LINE );
SetIndexDrawBegin( 0, 0 );
return( 0 );
}

int start()
{ buffer[ 0 ]=Time[ 0 ];
return( 0 );
}

Rashid Umarov
Admin
15139
Rashid Umarov  
Format your code, please.
[Deleted]  
Rosh:
Format your code, please.

Sorry Rosh,

here the formated code.

Files:
time.mq4  1 kb
Ray
2647
Ray  
I think it is giving you a rising line. Look more closely.
[Deleted]  

Thanks Phy,


I think, you are right.

The line is rising !


I wrote an indicator and an EA and saw differences in the time.

Also the first 100 bars were different.

I still don't understand everything about MT4 !

But I'll see ...


Thanks a lot

Ulrich

[Deleted]  

Hello,

A survey is conducted in the context of the evolution of Expert Advisors.

Less than 2 minutes are needed to complete the form.

You will be automatically registered in a draw for an iPhone 16GB.

The results may be published on MorningNews.com & FinancialTimes.com

To participate: http://expertadvisor.questionform.com/public/Expert-Advisor