Forex Tester Forum (Professional Training Software for Traders) Forum Index Forex Tester Forum (Professional Training Software for Traders)

Back to main site   Risk disclosure
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to work with time

 
Post new topic   Reply to topic    Forex Tester Forum (Professional Training Software for Traders) Forum Index -> FT API
View previous topic :: View next topic  
Author Message
Terranin
Site Admin


Joined: 21 Oct 2006
Posts: 831

PostPosted: Mon Apr 28, 2008 5:39 pm    Post subject: How to work with time Reply with quote

ForexTester uses Borland Delphi time format for its functions like Time(), iTime() and others. So, if you use C++ compilers you should convert this time to C++ format.

Delphi format (TDateTime):

Delphi TDateTime is equals to double value. The integral part of a Delphi TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of the TDateTime value is fraction of a 24 hour day that has elapsed.

Following are some examples of TDateTime values and their corresponding dates and times:

0 12/30/1899 12:00 am
2.75 1/1/1900 6:00 pm
-1.25 12/29/1899 6:00 am
35065 1/1/1996 12:00 am

C++ format (Unix format):

C++ time is an integer value that shows how many seconds passed sinse 01/01/1970.

Converting functions:

Code:
unsigned int UnixStartDate = 25569;

unsigned int DateTimeToUnix(double ConvDate)
{
  return((unsigned int)((ConvDate - UnixStartDate) * 86400.0));
}

double UnixToDateTime(unsigned int USec)
{
  return((Usec/86400.0) + UnixStartDate);
}

_________________
Hasta la vista
Mike
Back to top
View user's profile Send private message
hjalamo



Joined: 01 Aug 2010
Posts: 1

PostPosted: Wed Nov 24, 2010 6:13 am    Post subject: time and itime function with c++ Reply with quote

Please.

I need developer a strategy that it will entry at 00:00

I have tried with "time, timeframe, itime (c++)" but i have got problems.

can you help me how to develop this code sentence?

Thanks.

Best Regards,

Humberto Álamo.
Back to top
View user's profile Send private message
FT Support



Joined: 11 Jul 2009
Posts: 902

PostPosted: Wed Nov 24, 2010 8:15 am    Post subject: Reply with quote

Hello,

Please refer to the last posts of this thread:
http://www.forextester.com/forum/viewtopic.php?t=2008
you can use "w_hour" and "w_min" variables to define an Entry point

_________________
Check our other products here:
www.fx-metropolis.com
www.forexcopier.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Forex Tester Forum (Professional Training Software for Traders) Forum Index -> FT API All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group