Skip to Content
Mastering Financial Pattern Recognition
book

Mastering Financial Pattern Recognition

by Sofien Kaabar
October 2022
Beginner to intermediate
288 pages
7h 2m
English
O'Reilly Media, Inc.
Content preview from Mastering Financial Pattern Recognition

Chapter 1. Importing and Processing Financial Data in Python

This chapter is dedicated to laying the foundation needed to analyze financial data through coding. This requires some preparation, such as downloading the right software and creating an algorithm that fetches historical data automatically.

By the end of the chapter, you should know how to automatically import historical financial data using Python, a skill that should save you time. So let’s get started.

Installing the Environment

The first step is to prepare the environment and everything else necessary for the success of the algorithms. For this, you need two programs:

  • A Python interpreter that you use to write and execute code
  • Charting and financial software that you use as a database

Let’s start with the Python interpreter. I use a software called SPYDER. Some people may be more familiar with other software such as Jupyter and PyCharm, but the process is the same. You can download SPYDER from the official website or, even better, download it as part of a bigger package called Anaconda, which facilitates installation and offers more tools. Note that it is open source, free-to-use software.

SPYDER’s interface is split into three windows, as you can see in Figure 1-1. The window on the left is used to write the code that is later executed (the algorithm is told to run and apply the code). Typically, you will see multiple lines of code in that area.

The window on the upper right is the variable explorer. Every time ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Advances in Financial Machine Learning

Advances in Financial Machine Learning

Marcos Lopez de Prado

Publisher Resources

ISBN: 9781098120467Errata Page