Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-18-2006, 03:12 PM
Junior Member
 
Join Date: Aug 2006
Posts: 21
knili is on a distinguished road
Time fucntion question

Does anyone knows why this
Alert (TimeToStr(Time[2300], TIME_DATE));
Displays the date as 1970.01.01
while this
Alert (TimeToStr(Time[2299], TIME_DATE));
Displays the date as 2006.09.05

Thanks
Kam
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-18-2006, 03:27 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Smile

Quote:
Originally Posted by knili
Does anyone knows why this
Alert (TimeToStr(Time[2300], TIME_DATE));
Displays the date as 1970.01.01
while this
Alert (TimeToStr(Time[2299], TIME_DATE));
Displays the date as 2006.09.05

Thanks
Kam
Hi Kam!

You are very lucky that the Time[] function of the bar 2299 returned 2006.09.05. which means you have up-to 2300 bars on your chart (I'm kidding)!

The Time[] function returns the open time of the given bar!
The reason you've got 1970.01.01 for the bar 2300 is that you don't have 2300 bar on your chart and the Time[2300] have to return -1.
But the TimeToStr() function when saw -1 it returned the default date 1970.01.01.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-18-2006, 07:52 PM
Junior Member
 
Join Date: Aug 2006
Posts: 21
knili is on a distinguished road
Thanks for the info. I'm clear on that now
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
time question ajk Questions 1 03-23-2007 03:02 AM
Simple question of determining the time of day Fishtank Metatrader 4 2 04-04-2006 04:12 AM
Question: Time base exit yaniv_av Questions 5 11-16-2005 11:35 PM


All times are GMT. The time now is 01:54 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.