A couple of weeks ago, a student of mine on Python Algo Trading: FX Trading with Oanda asked me how to download historical fx data from the Oanda V20 API. I developed the following simple Jupyter notebook to assist him his query.
The basic idea of this notebook is to extract 250 days of daily open, high, low, close price of EURUSD. The steps are
- Import the relevant libraries
- Instantiate with your access details
- Provide Oanda with the parameters
- Submit your request for data
- Once the FX data is returned, you can conduct more thorough analysis with it. This can be for technical indicators calculation, statistical analysis, or even apply machine learning to these raw data.
For code cell 2: You will need to provide your own account ID and access token.
If you like what you read, do remember to subscribe.