Get oldest available data

Moderator: Moderator

Get oldest available data

Postby reach4thelasers » Fri Nov 11, 2016 11:01 am

How can I get the oldest available data for an instrument/timeframe using the maket data snapshot API? Certain instruments are at an all-time high or low and therefore I'm not certain how far back I need to go.

If I choose a wide range I get the most recent data, if If I take a guess e.g. DateTime.UTCNow.AddYears(-23) to DateTime.UTCNow.AddYears(-22) then it silently fails as it can't find any data.

I guess I need the date of the oldest candle then I can request from that date, but not sure how to get it.
reach4thelasers
 
Posts: 5
Joined: Fri Apr 15, 2016 1:58 pm

Re: Get oldest available data

Postby Georgiy » Mon Nov 14, 2016 3:55 am

Hi reach4thelasers,

Please, find "GetHistPrices" example in the ForexConnectAPI directory.
It gets data till specified date in past. If you specify the earliest date in past, you will get all data.
Georgiy
FXCodeBase: Initiate
 
Posts: 150
Joined: Tue Jul 29, 2014 4:49 am


Return to ForexConnect API

Who is online

Users browsing this forum: No registered users and 8 guests