Abstract
In this chapter we discuss the benefits of using Python to analyse financial markets. We discuss the parallels between the stages involved in solving a generalised data science problem, and the specific case of developing trading strategies. We outline the general stages of developing a trading strategy. We briefly describe how open source Python libraries finmarketpy, findatapy and chartpy aim to tackle each of these specific stages. In particular, we discuss how abstraction can be used to help generate clean code for developing trading strategies, without the low level details of data collection and data visualisation. Later, we give Python code examples to show how we can download market data, analyse it, and how to present the results using visualisations. We also give an example of how to implement a backtest for a simple trend following trading strategy in Python using finmarketpy.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
arctic: High performance datastore for time series and tick data. http://github.com/manahl/arctic
BLPAPI: Bloomberg market data library. https://www.bloomberglabs.com/api/libraries/
bokeh: Python interactive visualization library. http://bokeh.pydata.org/en/latest/
chartpy: Python data visualisation library. http://www.github.com/cuemacro/chartpy
Cython C: Extensions for python. http://www.cython.org
findatapy: Python finanical data library. http://www.github.com/cuemacro/findatapy
finmarketpy: Python financial trading library. http://www.github.com/cuemacro/finmarketpy
flask: Micro web framework. http://flask.pocoo.org
IPython: Enhanced interactive console. http://www.ipython.org
matplotlib: Python plotting library. http://www.matplotlib.org
NumPy: Package for scientific computing with Python. http://www.numpy.org
pandas: Python data analysis library. http://pandas.pydata.org
ploty: Collaboration platform for modern data science. http://plot.ly
PyMC3: Probabilistic programming in python. http://github.com/pymc-devs/pymc3
Quandl: Market data API. http://www.quandl.com/
scikit-learn: Machine learning in python. http://scikit-learn.org/stable/
SciPy library: Fundamental library for scientific computing. https://www.scipy
Sympy: Symbolic mathematics. http://www.sympy.org/en/index.html
TensorFlow: Open source library for machine intelligence. https://www.tensorflow.org
xlwings: Python for excel. http://www.xlwings.org/
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this chapter
Cite this chapter
Amen, S. (2017). Using Python to Analyse Financial Markets. In: Ehrhardt, M., Günther, M., ter Maten, E. (eds) Novel Methods in Computational Finance. Mathematics in Industry(), vol 25. Springer, Cham. https://doi.org/10.1007/978-3-319-61282-9_29
Download citation
DOI: https://doi.org/10.1007/978-3-319-61282-9_29
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-61281-2
Online ISBN: 978-3-319-61282-9
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)