Jump to content

Recommended Posts



I'm trying to get hold of minute by minute historic price data for EURUSD in the form of an excel/csv file. Could someone let me know how to do this using CIAPI?


More specifically, I'm interested in the time periods just before close to just after open e.g. Fridays 7pm until Sunday 11pm.

Also, I'd like the data to cover quite a few weeks - I'm hoping 52 weeks is feasible.


Would be great to also  Open, High, Low and Close for each data point/minute.


In my head the output data would look something like this:


Timestamp Open High Low Close 2015:02:27-19:00:00 11205.4 11204.8 11207.4 11204.9 2015:02:27-19:01:00 11205 11204.9 11206.1 11205.8 2015:02:27-19:02:00 11205.7 11203.4 11206.2 11203.4 2015:02:27-19:03:00 11203.3 11200.2 11204.2 11200.2 2015:02:27-19:04:00 11200.3 11199.8 11202.4



I have some coding experience but I must confess not that much!


Any help greatly appreciated.





Share this post

Link to post

Hello 10K,


For a minute time frame, you can only retrieve data going back 5 days on a rolling basis starting from the current day. Probably not sufficient for the analysis you want to perform??


Anyway, the call you would use in the CIAPI to retrieve the data is:



The documentation explaining this call can be found at: http://docs.labs.cityindex.com/#HTTP Services/GetPriceBars.htm%3FTocPath%3DCIAPI%2520Reference%7CHTTP%2520Services%7CPrice%2520History%7C_____1


You would of course need code to wrap around this call, for example to login to your account and parse the data downloaded etc. Additionally, the date time stamp is in Unix time, which is the number of seconds elapsed since 1st Jan 1970. You'd need to write a converter to get a standard date/time.


You can however save yourself a lot of trouble by using our XcelTrader addin instead!! XcelTrader is an addin to Excel that enables you to place trades/orders etc from within Excel. One of the built in XcelTrader functions is PRICEHISTORY. It can download all 5 days worth of minute data with a standard date time for you. See the example image below.


XcelTrader is currently only a beta release so is still under development. You can get it from the following webpage: http://www.cityindex.co.uk/excel-plugin/


Note: you'll need a City Index account as XcelTrader logs into your account to access all functionality.







Share this post

Link to post

Thanks Physicsman. I've downloaded XcelTrader and have been able to replicate the screenshot above. I did find that it only covered 2 1/2 days though and weirdly it won't let me cut and paste. I'm guessing this is down to it being a beta version.


I understand that 1 minute price data isn't held for long - is 5 minute or 10 minute data held for longer? Those intervals would do the job for me at least for now.


It looks like I will need to use the actual CIAPI to retrieve the data. A shamefully basic question but how and where do I actually run the script you suggested?

Share this post

Link to post

I was in the middle of a reply to your earlier query when your latest post appeared. 


The only point left to address is with regards to the cut and paste issue. This has already been reported as a bug for our development team to fix.


The temporary workaround is simple: Disconnect XcelTrader from your account when you are developing your spreadsheet and this stops the problem from occurring!!  :) 


As a general rule, even when the bug is fixed in a future release we would always suggest developing your spreadsheets when you are disconnected from your account. This could stop any accidents from occurring such as accidentally firing off some trades into your account etc.  :o


You can see all the posts regarding XcelTrader in the sub-forum we have dedicated to it at: http://www.advantagetrader.net/


The specific thread about the bug is at: http://www.advantagetrader.net/index.php?/topic/354-xceltrader-affects-copy-and-paste/



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