Skip to main content

Using Python to Analyse Financial Markets

  • Chapter
  • First Online:
Novel Methods in Computational Finance

Part of the book series: Mathematics in Industry ((TECMI,volume 25))

  • 2648 Accesses


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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD 139.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 179.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 179.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions


  1. arctic: High performance datastore for time series and tick data.

  2. BLPAPI: Bloomberg market data library.

  3. bokeh: Python interactive visualization library.

  4. chartpy: Python data visualisation library.

  5. Cython C: Extensions for python.

  6. findatapy: Python finanical data library.

  7. finmarketpy: Python financial trading library.

  8. flask: Micro web framework.

  9. IPython: Enhanced interactive console.

  10. matplotlib: Python plotting library.

  11. NumPy: Package for scientific computing with Python.

  12. pandas: Python data analysis library.

  13. ploty: Collaboration platform for modern data science.

  14. PyMC3: Probabilistic programming in python.

  15. Quandl: Market data API.

  16. scikit-learn: Machine learning in python.

  17. SciPy library: Fundamental library for scientific computing. https://www.scipy

  18. Sympy: Symbolic mathematics.

  19. TensorFlow: Open source library for machine intelligence.

  20. xlwings: Python for excel.

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to Saeed Amen .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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.

Download citation

Publish with us

Policies and ethics