You can use this data to backtest your trading strategies, and perform technical analysis such as plotting the EMA , RSI or MACD.
The spreadsheet is easy to use. You simply enter two three-letter currency symbols , two dates, and specify whether you want the bid, ask or mid price. After clicking a button, the spreadsheet will then connect to a webservice, and download daily bid rates using some clever VBA. As an example, the spreadsheet plots the exchange rate data. If you wanted, you could easily add Bollinger Bands to the plot.
The VBA is not password-protected — feel free to modify, extend or reuse the code, or even learn from the principles embodied therein. Using the VBA programming principles used in the spreadsheet, you can easily use other tools, like Access databases, instead of Excel. You may also be interested in this spreadsheet which downloads historical stock prices from Yahoo straight into Excel.
Update 29th July Download Excel Spreadsheet for Automatically Downloading Forex Data from the Internet. I am interested in working this code into an existing workbook I have made. This looks like an awesome tool and will do most of what I need it to do. How can I go about getting that password for the VBA code though so I can validate a few things? Hi, I am really interested in the code, im having a few problems getting my workbook to do the same thing but with stock data. I've removed the password from the spreadsheet just download it again.
Let me know what you super cool applications you come up with! It looks like a terrific tool to use with excell. Hi, I found your code very useful and have embedded it into one of my sheets. I would suggest updating the connection on each refresh rather than creating a new one as all of the connections will be refreshed on open unless this property is turned off on creation.
The following code will achieve this: Delete Next qt End Sub. Hi, works fantastic for me. I only had a problem using it on a german Excel version as the decimal separator was not correctly recognized. This could be overcome letting Excel know which character to recognize as the decimal separator.
Maybe you could include it in your version to help other users who maybe jump into the same problem:. Thanks a lot, you saved me plenty of time. Thanks a lot for this very useful tool! Just a remark on my side: Try the technique at http: Sam, Thank you for this very useful program. One thing I want to do is input either daily or weekly in the parameters box. It almost works flawlessly! I think the URL you are building in the macro is an old one. I tried to re-write the macro building a new URL which appears to work but then the section of code which creates the data sheet breaks.
Any chance you could have a look? The complete URL which gets me to a csv table is http: So I sort of figured it out. The URL you used builds a link to a download file, whereas the one I posted above links you to a table on a web page.
Plus, if you use bid, ask, or mid it does return different numbers.
So thanks very much. I just wish I could have multiple currency pairs in one sheet… or better yet have all of this going straight into powerpivot! Samir — awesome — time saving and easy to use. OANDA has changed its website in the past days. Data is no longer available. Do you have a solution? I am using a macro I built from scratch 2 years ago but I cannot find a good source website now to get exchange rates. I appreciate your feedback.
The are not matching up. Are you providing the daily average? I double checked today again and I am getting weekend results. Thanks for such good website. However, I am also looking if there is any possibility to get the rates from Oanda.
Thank you very much. When I try to embed the code into my existing workbook I get a runtime error however. Any ideas why this occurs? I need to know if it is possible to get data as below: On a particular date, if we need exchange rate for these many currencies.
Can it be possible through adjustment in above coding. Hello there, is there any solution for this request since the rest of the code and way of exporting information is perfect only need this to implement it in my sheets so it can populate all currencies needed at once. OANDA now has also changed the historical data page and calls it …historical-rates-classic.
I tried to code my macro to download from this page but I guess they also changed the format of the date in the link. I checked with your excel sheet, ForexExcelImport. Do you know of another website that has historical forex data that I can download with the definition of a period?
I guess, you have not downloaded correct sheet. Your means of describing the whole thing in this post is actually nice, all be able to simply be aware of it, Thanks a lot. This is excellent, thanks Samir! The code is just fantastic and works fine on my US laptop! I only had a problem using it on a german Excel version in my office as the decimal separator was not correctly recognized.
I am trying to use this tool to streamline some financial information but there seems to be a bug in the code I downloaded. No matter what I fill in in the excel sheet, the code always seems to extract the same period between today and a month ago, whereas I need much older data.
How far back does the code go? AS Simon said this is not working properly anymore? Is there any alternative way of getting the data? Could this be fixed? I download the latest version of ForexExcelImport. This spreadsheet is really awesome. I am looking to expand the date range, however, it appears that the data is being drawn from a csv file which is automatically set to the last 30 days. How do you code the excel spreadsheet to draw from the csv file from the past 1 year?
Hi there — thanks for producing this spreadsheet it is very useful! Is it possible to have a version without a password for the code? Hi, looks like the Oanda link in the Macro for historical FX rates has stopped working.
How to Import Currency (Forex) Data from the Internet into your Spreadsheet
This may be due to Oanda stopping providing the service for free. Any idea what the syntax would be for getting the FX data from Yahoo Finance? I only discovered your tool two or three months ago and have enjoyed convenience and accuracy the macro has allowed me to build reports for work for internal use, not a publicly traded company , but it appears that sometime since April 1 Oanda has changed something in the structure of their databases that renders the workbook outdated.
I discovered there was a problem when I started updating my reports for April data and the macros did not update my main table as I expected. Your email address will not be published.
Westernpips Group: Latency Arbitrage Forex Software
Use Excel to get forex data from Yahoo! Finance
February 29, at When you loaded the spreadsheet in Excel, did you give the macro permission to run? September 19, at 3: October 10, at 5: I tried the worksheet.
October 10, at 8: October 17, at 5: October 28, at Refresh Another approach would be to delete all existing connections before adding a new one: January 4, at 7: It is possible to modify to show the open, high, low, and close? Thanks in advance , Lance. March 20, at 7: Maybe you could include it in your version to help other users who maybe jump into the same problem: March 28, at 5: April 15, at 9: October 7, at October 7, at 6: November 5, at 3: January 10, at Hi Sam, Thank you so much for this.
January 20, at 2: You can now choose either the bid, ask or mid rate. January 16, at 1: January 16, at 4: April 2, at 8: April 2, at April 4, at 7: Hello Samir, OANDA has changed its website in the past days. April 5, at 2: Impressive tools for the data-driven! I have 2 questions for you: If you could spare a moment to address these I would be very appreciative. April 6, at 7: Hi, Thanks for such good website. April 28, at 6: June 3, at 2: Hi, I need to know if it is possible to get data as below: ZAR On a particular date, if we need exchange rate for these many currencies.
October 12, at 8: Thank you in advance. Also big thanks to Samir. June 18, at 4: Dear Shamir, OANDA now has also changed the historical data page and calls it …historical-rates-classic. June 20, at 7: June 28, at 5: August 17, at 6: February 9, at February 17, at 9: Thank you very much for your help, great work! March 23, at 7: Hi, I am trying to use this tool to streamline some financial information but there seems to be a bug in the code I downloaded.
Any idea where the problem could be? March 23, at May 29, at 3: Hi, AS Simon said this is not working properly anymore? May 29, at 4: June 19, at 4: I really appreciate your help and advice!! July 6, at 2: This was very easy to understand and implement.
July 15, at 3: March 7, at 9: April 11, at May 1, at 3: Hello, I only discovered your tool two or three months ago and have enjoyed convenience and accuracy the macro has allowed me to build reports for work for internal use, not a publicly traded company , but it appears that sometime since April 1 Oanda has changed something in the structure of their databases that renders the workbook outdated. Do you expect to update this workbook any time soon?
I would appreciate if you do!