Jump to content
Sign in to follow this  
JTGnj

FX Historical Data Has Only 2 Decimal Places

Recommended Posts

Has anyone else dealt with the issue of some historical FX data only coming in with two decimal places?

Here is an example of the code I run:

URL =  'https://ciapi.cityindex.com/TradingAPI/market/'+ str(MarketId) + '/barhistory?interval=DAY&span=1&PriceBars=4000&PriceType=BID'
r = requests.get(url=URL, headers=HEAD)
df = pd.DataFrame(r.json()['PriceBars'])
df = df[['BarDate','Open','High','Low','Close']]
df.BarDate=df.BarDate.apply(lambda x: x[6:19])
df.BarDate=pd.to_datetime(df.BarDate,unit='ms')
print(df.head())

The output is:

 BarDate  Open  High   Low  Close
0 2005-11-08  0.87  0.87  0.87   0.87
1 2005-11-09  0.87  0.88  0.87   0.87
2 2005-11-10  0.87  0.88  0.87   0.87
3 2005-11-11  0.87  0.87  0.87   0.87
4 2005-11-14  0.87  0.87  0.87   0.87

For more recent data I get 5 decimal places but for data ~pre-2011 it is all 2 decimal places. 

Is there a formatting structure I am missing? 

Thanks!

Share this post


Link to post

Hello,

Unfortunately, we no longer have our prices for the affected markets from that period (pre-2011) so we cannot correct the data. Hopefully, you are able to perform your analysis on the data from 2011 - present.

Kind Regards, PM

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×