Ticks not sorted by time?

How to create strategies and indicators
Message
Author
Robopip
Posts: 26
Joined: Thu Jun 21, 2012 12:03 am

Ticks not sorted by time?

#1 Postby Robopip » Tue May 07, 2013 6:53 pm

Hi,

I have noticed that in my strategy (and function GetSingleTick()) that TimeCurrent() sometimes "jumps back".

Consider this simple strategy:
EXPORT void __stdcall GetSingleTick()
{
TDateTime curr_time;
static TDateTime last_time = 0;
char curr_time_str[80], last_time_str[80];

if (strcmp(Symbol(), "EURUSD") == 0)
{
curr_time = TimeCurrent();
if (last_time > 0 && last_time > curr_time)
{
strcpy_s(last_time_str, from_time(ctime(last_time), "YYYY.MM.DD HH24:MI:SS"));
strcpy_s(curr_time_str, from_time(ctime(curr_time), "YYYY.MM.DD HH24:MI:SS"));
vPrint("last_time > curr_time: %s > %s", last_time_str, curr_time_str);
}
last_time = curr_time;
}
}

Print out this:
2000.03.30 22:45:00 last_time > curr_time: 2000.03.30 22:45:44 > 2000.03.30 22:44:59
2000.03.30 22:46:00 last_time > curr_time: 2000.03.30 22:46:30 > 2000.03.30 22:45:59
2000.03.30 22:47:00 last_time > curr_time: 2000.03.30 22:47:30 > 2000.03.30 22:47:00
2000.03.30 22:48:00 last_time > curr_time: 2000.03.30 22:48:44 > 2000.03.30 22:47:59
2000.03.30 22:50:00 last_time > curr_time: 2000.03.30 22:50:30 > 2000.03.30 22:50:00
2000.03.30 22:51:00 last_time > curr_time: 2000.03.30 22:51:29 > 2000.03.30 22:50:59
2000.03.30 22:53:00 last_time > curr_time: 2000.03.30 22:53:30 > 2000.03.30 22:53:00
2000.03.30 22:55:00 last_time > curr_time: 2000.03.30 22:55:29 > 2000.03.30 22:54:59
2000.03.30 22:58:00 last_time > curr_time: 2000.03.30 22:58:44 > 2000.03.30 22:57:59
2000.03.30 22:59:00 last_time > curr_time: 2000.03.30 22:59:30 > 2000.03.30 22:59:00
-------------------------------------------------------------------------------
Shouldn't TimeCurrent() always "grow" as ticks goes by?

PS I have tried to generate ticks again, but this "problem" remains. DS

FT Support
Posts: 905
Joined: Sat Jul 11, 2009 10:54 am

#2 Postby FT Support » Thu May 09, 2013 1:35 pm

Thank you for your notes.

We will check that and will get back to you if we have any updates
Check our other product here:
http://www.forexcopier.com

Robopip
Posts: 26
Joined: Thu Jun 21, 2012 12:03 am

#3 Postby Robopip » Mon May 13, 2013 5:16 pm

I might have found the problem.
The problem is my source data, it seems to have "double" rows sometimes.
Like this:
EURUSD,20000330,224500,0.9615,0.9617,0.9613,0.9614,6
EURUSD,20000330,224500,0.9627,0.9627,0.9625,0.9626,4

My problem now, is to determine which row is valid... :-P

FT Support: Thanks for your help, but I beleive the problem is in my indata and not in your software.


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 19 guests