How to Import Indian equities Data to zipline on your local machine?

How to Import Indian equities Data to zipline on your local machine?

zipline is probably the most mature and powerful backtesting and live trading engine. It is developed, maintained, and used in production by Quantopian Inc. Quantopian is a Boston based crowed source technology and asset management firm. Anyone can create a free account on their website to develop and backtest their strategy with rich fundamental and minute level data.

zipline is probably the most mature and powerful backtesting and live trading engine. It is developed, maintained, and used in production by Quantopian Inc. Quantopian is a Boston based crowed source technology and asset management firm. Anyone can create a free account on their website to develop and backtest their strategy with rich fundamental and minute level data.

zipline is the backtesting engine on their website. However, it can also be downloaded and installed locally. Local installation of the zipline is a little complex, hence you need to refer to zipline Documentation on how to perform a local setup. It is much easier to use their website with free availability of rich historical data than run the strategy locally. However, everything done on their website needs to stay on the website.

When you have a local setup of zipline, you need to supply your own data. This is called Ingesting your own custom bundle. There is some help available on how to set up a single asset data, however, nothing much is available on multiple stocks. Andreas F. Clenow has explained the process to set up your own custom bundle very well in his exceptional book — ‘Trading Evolved: Anyone can Build Killer Trading Strategies in Python’. However, there are many challenges if you want to do this for Indian equities and especially with free Quandl data.

In this article, I will go through the step by step process on how to create your own custom bundle for S&P BSE 500 constituents assuming you have already created a virtual environment as env_zipline and installed zipline in the former on your local machine.

Following are the steps involved to Ingest your own custom bundle and test it:

  1. Download 500 stocks data from Quandl and store them as individual .csv files.
  2. Clean up data to match 'XBOM’ trading calendar and create a custom bundle.
  3. Ingest last 15 years of daily OHLCV data for 500 stocks of the S&P BSE 500.
  4. Test your newly created custom bundle by running a moving average crossover strategy for Infosys Ltd. stock.

investing quantitative-finance backtesting trading quantopian

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How is Finance and Investment Changing?

Due to several factors, the financial and investment landscape is currently undergoing a significant shift. Chief among them is the economic crisis resulting from the COVID-19 pandemic that subsequently forced nations to lock down their economies.

Statistical Arbitrage with Pairs Trading and Backtesting

Statistical Arbitrage (Stat Arb) are trading strategies that typically take advantage of either mean reversion in share prices or opportunities created by market microstructure anomalies

Algorithmic Trading with Python: Bollinger band strategy. (Quantitative finance)

In this video, we are going to explore how to use mathematics and algorithmic trading to hack the market.Bollinger bands are based on a normal distribution. ...

Backtest Trading Strategies with Pandas — Vectorized Backtesting

A fast and efficient approach to evaluate trading strategies. Today, I will discuss how vectorized backtesting can help you “answer” that question, how to implement it using Pandas, and what subtleties should you be aware of.

Quantitative Finance in Python

Introduction to the time value of money with code. The first quantitative class for vanilla finance and quantitative finance majors alike has to do with the time value of money.