Less code, more research.
requirements: python 3 + numpy + pandas + quandl(or you can modify code to other datasource) + matplotlib(optional only if you need chart)
copy the whole directory into your desired folder, modify Sample_Test.py and run it. remove the plot func if you not have matplotlib.
haven't got time to write documentation, but debug always works :)