About Vaishali

If you want to build trading models and algorithms with Python, you need to first access market price data. Without this data, it is impossible to build a trading algorithm. In a lot of our tutorials here at Python For Finance I’ve shown you how to build trading algos off of data that you’ve manually imported into a CSV file on your computer.

But what if you don’t want to manually import a CSV file? What if you want your Python code to automatically grab the market price data from the web?

Continue reading →

Pandas is a popular python library used for data manipulation and analysis. This is especially useful in finance as there’s a lot of data involved. For example, pandas can be used for analyzing stock market data and backtesting trading strategies.

The basic data structure pandas uses is called a DataFrame. This has a table structure with rows and columns for recording observations under different categories. This looks similar to an excel spreadsheet. In this post, I’ll cover some basics of pandas dataframe.

Continue reading →

With the ever increasing popularity of using quantitative trading strategies to perform systematic trading, in this post I’ll be showing you how to build simple quant trading strategy using Python. A quant trading strategy is one where decisions for buying and selling securities is based upon conditions that are created from analyzing large amounts of data and finding profitable strategy. These conditions could be anything like “buy S&P 500 when the price goes above it’s 200 day simple moving average and sell when the price falls below the 200dma”. This in turn helps eliminate human emotions and personal biases from trading decisions.

Continue reading →