From the course: Practical Python for Algorithmic Trading

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Filter rows and create columns for trading strategies

Filter rows and create columns for trading strategies - Python Tutorial

From the course: Practical Python for Algorithmic Trading

Filter rows and create columns for trading strategies

- [Instructor] If we want to build an investment strategy, we need to calculate what will happen in the future. In our case, if the stock will go up or down based on the current data that we have for the stock on a given date. Where do we start in this tutorial? With the Microsoft daily stock price since 1986. We have the usual columns that we can expect from a stock data and we need to write the lines of codes that will take us to have this column. In the next chapter, we will create a machine learning model that will be able to predict this column based on these features. To make a case study more practical, we will focus on when Microsoft acquired LinkedIn. That was on December 8th, 2016 for $26.2 billion. Our dataset contains the information since 1986. To filter the rows, we need to locate the data frame. Now we separate between rows and columns. We want all of the columns, so we place a colon. And in the rows, we…

Contents