After you did setup your cloud environment including IPython/ Jupyter you are able to make the next steps.
Be sure that IPython is started and accessible. Perhaps you need to open a port on the firewall so that you can connect to IPython from anywhere. The default port is 9999.
But before you call OANDA API functions, there are still some prerequisites that need to be met. But luckily you can do everything from within IPython.
The first step is to obtain the python OANDA api wrapper and then configure your OANDA credentials. You can generate a token in the OANDA webinterface after you log in. Be sure to use a practice account for your first experiments.
And finally you need to do the import.
Those first three steps are shown on this IPython screenshot:
Now you're ready to connect to the API and play around with it to see if everything works as expected.
In my example I fetch a list of all instruments that are available for trading with OANDA, print a filtered list of instruments I'm interested in and then print the ask/ bid price of Gold (XAU/USD).
If you are going to practice and learn automated trading with python, the first step is to setup your environment and get comfortable with it.
Before you choose your platform and tools, there are some considerations you have to make regarding your requirements.
Here is the list of my main requirements;
Having these points in mind, my technology stack looks like this:
To bring this to the cloud, you would need a cloud service provider that gives you access via remote desktop connections or via ssh. There are a lot of python/ IPython service provider that offer free or paid Jupyter notebooks - I tried a lot of them, but most of them are too restrictive.
One option would be to setup a micro instance in the Amazon cloud and then install the Python/ anaconda/Jupyter stuff manually which is no big deal. If you register a developer account at AWS you can use the service free for one year.
I made a different choice - I registerd a Data Science Virtual Machine at the Microsoft Azure cloud.
This VM has everything pre-installed and there is not only the python-stuff, there is a lot of other fancy stuff that can be used for automated trading and quantitative analytics:
In my next blog post I will show how to install the oandapy package and use it with IPython to connect to the Oanda API.
This is the place where I'm going to share news, ideas and other content on algorithmic trading and related topics.
Blog posts will contain: