ProtoOAGetTickDataReq Assistance
ProtoOAGetTickDataReq Assistance
09 Jan 2021, 18:10
I have a query around the response for tick data
in my example i am requesting tick data for USDTRY between "2020/Nov/17 11:32:44" and "2020/Nov/16 12:32:44"
my timestamp data including the milliseconds are
from 1605519164000
to 1605529964000
i get the below response (i have suppressed all the rows as too many to show)
ctidTraderAccountId: 19137822
tickData {
timestamp: 1605529960134
tick: 773874
}
tickData {
timestamp: -8985
tick: -45
}
tickData {
timestamp: -1135
tick: -5
}
etc......... too many rows to paste
the initial timestamp that comes back is 1605529960134 which matches closely to my 'TO' date
i get back an additional 2,472 additional tickData timestamps and ticks
the lowest timestamp value is -99032, when i subtract this from the baseline timestamp of 1605529960134 , i get a value of 1605529861102, this is only 99 seconds before my 'TO' date, when i was expecting data for an hour
have i miss understood how the timestamps should work as i cant seem to get it to match up
Replies
jayteasuk
11 Jan 2021, 09:42
RE:
PanagiotisCharalampous said:
Hi jayteasuk
Your ProtoOAGetTickDataRes has a hasMore field. If this is set to true, it means that not all data have been sent and you need to request them again using the last timestamp as the new TO value. Execute this recursively until you receive all the data.
Best Regards,
Panagiotis
Thank you
Roughly what is the max rows/time period for requesting tick data
@jayteasuk
PanagiotisCharalampous
11 Jan 2021, 10:20
Hi jayteasuk,
The limits are 100000 rows or one week of data.
Best Regards,
Panagiotis
@PanagiotisCharalampous
jayteasuk
11 Jan 2021, 19:01
RE:
PanagiotisCharalampous said:
Hi jayteasuk
Your ProtoOAGetTickDataRes has a hasMore field. If this is set to true, it means that not all data have been sent and you need to request them again using the last timestamp as the new TO value. Execute this recursively until you receive all the data.
Best Regards,
Panagiotis
ok i have pulled data from 11/16/2020 @ 11:32am to 11/16/2020 @ 12:32pm (UTC)
1605526364000 to 1605529964000
This returns 2,3290 rows containing 820 tickData entries
The expectation is this returns 1 hours worth of tick data for USDTRY
I have a hasMore: false at the end of the data which is what i would expect as its less then 100,000 rows and under 1 week of data, also confirms i received all the data
The minimum tick timestamp is -49997
This gives me a time range of 2020-11-16 12:31:50.000 to 2020-11-16 12:32:39.000
This gives me around 49 seconds of data, not the 1 hour i was expecting
I have tried another test pulling 11/15/2020 @ 12:32pm (UTC) to 11/16/2020 @ 12:32pm (UTC)
1605443520000 to 1605529964000
Expecting 24 hours of data
End of the file has hasMore: false
35,622 rows returned, containing 8,903 tickData entries
The minimum tick timestamp is -917027
This gives me a time range of 2020-11-16 12:17:23.000 to 2020-11-16 12:32:39.000
This gives me approx 15 minutes not the 24 hours i was expecting
Am i missing something from my calculations?
@jayteasuk
PanagiotisCharalampous
12 Jan 2021, 07:53
Hi jayteasuk,
Please note that the timestamp delta (and all deltas in general) is the distance from the previous tick and not from the first one. So to get the time for the last tick, you need to add all the deltas from the first one. Can you please confirm that this is how you do it?
Best Regards,
Panagiotis
@PanagiotisCharalampous
jayteasuk
12 Jan 2021, 08:37
RE:
PanagiotisCharalampous said:
Hi jayteasuk,
Please note that the timestamp delta (and all deltas in general) is the distance from the previous tick and not from the first one. So to get the time for the last tick, you need to add all the deltas from the first one. Can you please confirm that this is how you do it?
Best Regards,
Panagiotis
I have that working now thank you
@jayteasuk
PanagiotisCharalampous
11 Jan 2021, 09:19
Hi jayteasuk
Your ProtoOAGetTickDataRes has a hasMore field. If this is set to true, it means that not all data have been sent and you need to request them again using the last timestamp as the new TO value. Execute this recursively until you receive all the data.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous