As explained above, if you are an investor, you must be aware that in 2020 & 2021, one of the trendiest commodity is Gold.
Indeed, Gold is correlated negatively to economic growth, and in time of the pandemic, that has been a lucrative investment for multiple investors.
Now, the question is, how to get robust and trustful Gold price data for a specific local currency (either if you are American, Canadian, Indian, British … )?
Let’s analyze now how you can hack it using Quandl.
Quandl API is working using a tick code & an API key, which can be accessed for free. (All explanations in the tutorial videos in the last part, plus a gift). The user will need to insert the following 3 arguments (tick code, start & end date) and type the following code structure in order to request data:
quandl.get(tick code, start_date, end_date)
Now that we got the structure, the first step will consist of researching “Gold Price”, in the research bar at the top left corner.
Once the research has been performed, we will select a free dataset of our choice.
I am going to use the dataset provided by the London Bullion Market Association for the test. According to Quandl, LBMA is an international trade association in the London gold and silver market, consisting of central banks, private investors, producers, refiners, and other agents & an official data provider.
The tick code associated is “LBMA/GOLD”. So, let’s type the following line of code:
And here is the output:
Now if you want to plot your data:
You can have the full code explanation in the video tutorial(Part III, minute 8:25 to 11:20).
Overall, the data looks accurate (less than 1$ difference) if you compare it to Bloomberg.
The first test is positive.
The second test, how can we upload and request US stock exchange data for investment and algorithmic trading?
If you want to learn how to start with algorithmic trading with Python and impress your colleague at work or university. I highly recommend the following course, most of the code has been taken from this source:
Similarly to the request above, we are going to start by searching for market data.
We will choose wiki continuous future as a data source and request to get data for GOOGLE. The ticker for this request is “WIKI/GOOG”. So, let’s type the following line of code:
Once we have executed the line of code above, here is the output:
Boom! We got the data, plus extra information regarding split ratio, volume & dividends.
My opinion:
The possibility to download market data through Quandl API is not the most efficient. I have tested a couple of other API in the past, such as Yahoo Finance or Bloomberg, and the difference is important. You can find the full test below and see by yourselves the difference:
However, I like the fact that Quandl is providing the possibility to get dividends day and the amount. As an investor and algorithmic trader that an excellent point to add to our model.
Now, that we have tested the market data import, let’s jump to the last test.
Did you ever ask yourselves if your monthly rent is over or underpriced? Or based on your area, if your one-bedroom apartment bought was overpriced?
In this section, we are going to explore how to download local real estates data using Quandl.
Similarly to what we have done previously, you will need your ticker code. To find it we are going to search “Zillow New York” in the search bar at the top left corner.
Once you have chosen the New-York’s borough data that you want, you should type the tick code and execute the following line of code:
In the line above we are requesting the data for a one-bedroom apartment in Harlem vs Manhattan midtown. (Full explanation in the video below. Minute 12:20 to 17:50)
And here is the final output of the price of a 1 bedroom apartment of 2 New York borough over-time:
My conclusion:
I hope you enjoyed this test; I took a lot of fun to decorticate this API. You can go further using Quandl API and test it yourselves.
Overall, Quandl has a lot of strength and disadvantage. The aim behind this article was to propose you to discover an API which you will be able to use in the future.
I am teaching data science to my son sometimes, and I like using Quandl because you can get a clean and official dataset in one line of code. Suppose you want to test your Artificial Intelligence and Machine Learning models. In that case, it can be an excellent way to have the necessary randomized data (mainly for a neural network which require a massive input dataset).
Furthermore, the types of data are wide. If you are working in medical, you can request plenty of data concerning healthcare, or if you are a statistician, you can explore data provided by the government on this platform to enhance your analysis.
If you want to know more about API’s test and how to code an algorithm for trading, I recommend the following youtube channel: