All Projects → quantopian → Zipline

quantopian / Zipline

Licence: apache-2.0
Zipline, a Pythonic Algorithmic Trading Library

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects
shell
77523 projects
Batchfile
5799 projects
powershell
5483 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to Zipline

51bitquant
51bitquant Python数字货币量化交易视频 CCXT框架 爬取交易所数据 比特币量化交易 交易机器人51bitquant tradingbot cryptocurrency quantitative trading btc trading
Stars: ✭ 284 (-98.07%)
Mutual labels:  algorithmic-trading, quant
Sgx Full Orderbook Tick Data Trading Strategy
Providing the solutions for high-frequency trading (HFT) strategies using data science approaches (Machine Learning) on Full Orderbook Tick Data.
Stars: ✭ 733 (-95.02%)
Mutual labels:  algorithmic-trading, quant
Quantdom
Python-based framework for backtesting trading strategies & analyzing financial markets [GUI ]
Stars: ✭ 449 (-96.95%)
Mutual labels:  algorithmic-trading, quant
FinRL Podracer
Cloud-native Financial Reinforcement Learning
Stars: ✭ 179 (-98.78%)
Mutual labels:  quant, algorithmic-trading
Zvt
modular quant framework.
Stars: ✭ 1,801 (-87.76%)
Mutual labels:  algorithmic-trading, quant
Tai
A composable, real time, market data and trade execution toolkit. Built with Elixir, runs on the Erlang virtual machine
Stars: ✭ 264 (-98.21%)
Mutual labels:  algorithmic-trading, quant
Qlib
Qlib is an AI-oriented quantitative investment platform, which aims to realize the potential, empower the research, and create the value of AI technologies in quantitative investment. With Qlib, you can easily try your ideas to create better Quant investment strategies. An increasing number of SOTA Quant research works/papers are released in Qlib.
Stars: ✭ 7,582 (-48.46%)
Mutual labels:  algorithmic-trading, quant
pyEX-zipline
pyEX + Zipline
Stars: ✭ 22 (-99.85%)
Mutual labels:  algorithmic-trading, zipline
Abu
阿布量化交易系统(股票,期权,期货,比特币,机器学习) 基于python的开源量化交易,量化投资架构
Stars: ✭ 8,589 (-41.62%)
Mutual labels:  algorithmic-trading, quant
Quant Finance Resources
Courses, Articles and many more which can help beginners or professionals.
Stars: ✭ 36 (-99.76%)
Mutual labels:  algorithmic-trading, quant
Pylivetrader
Python live trade execution library with zipline interface.
Stars: ✭ 470 (-96.81%)
Mutual labels:  algorithmic-trading, quant
Financial Machine Learning
A curated list of practical financial machine learning tools and applications.
Stars: ✭ 2,172 (-85.24%)
Mutual labels:  quant, algorithmic-trading
Quantstats
Portfolio analytics for quants, written in Python
Stars: ✭ 823 (-94.41%)
Mutual labels:  algorithmic-trading, quant
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (-99.1%)
Mutual labels:  algorithmic-trading, quant
Quant Trading
Python quantitative trading strategies including VIX Calculator, Pattern Recognition, Commodity Trading Advisor, Monte Carlo, Options Straddle, Shooting Star, London Breakout, Heikin-Ashi, Pair Trading, RSI, Bollinger Bands, Parabolic SAR, Dual Thrust, Awesome, MACD
Stars: ✭ 2,407 (-83.64%)
Mutual labels:  algorithmic-trading, quant
Stock.indicators
Stock indicator technical analysis library package for .NET. Send in historical price quotes and get back desired technical indicators. Nothing more. It can be used in any market analysis software using standard OHLCV price quotes for equities, commodities, forex, cryptocurrencies, and others. We had private trading algorithms, machine learning, and charting systems in mind when originally creating this community library. Current indicators include: Accumulation/Distribution Line (ADL), Aroon Oscillator, Arnaud Legoux Moving Average (ALMA), Average Directional Index (ADX), Average True Range (ATR), Awesome Oscillator (AO), Balance of Power (BOP), Beta Coefficient, Bollinger Bands®, Chaikin Money Flow (CMF), Chaikin Oscillator, Chandelier Exit, Choppiness Index (CHOP), Commodity Channel Index (CCI), ConnorsRSI, Correlation Coefficient, Donchian Channels, Double Exponential Moving Average (DEMA), Elder-ray Index, Exponential Moving Average (EMA), Force Index, Fractal Chaos Bands (FCB), Gator Oscillator, Heikin-Ashi, Hull Moving Average (HMA), Ichimoku Cloud, Kaufman's Adaptive Moving Average (KAMA), KDJ Index, Keltner Channels, Momentum Oscillator, Money Flow Index (MFI), MESA Adaptive Moving Averages (MAMA), Moving Average Convergence/Divergence (MACD), Moving Average Envelopes, On-balance Volume (OBV), Parabolic SAR (stop and reverse), Percentage Volume Oscillator (PVO), Pivot Points and Rolling Pivot Points, Price Channels, Price (Comparative) Relative Strength (PRS), Price Momentum Oscillator (PMO), Rate of Change (ROC), Relative Strength Index (RSI), R-Squared (Coefficient of Determination), Simple Moving Average (SMA), Slope and Linear Regression, Smoothed Moving Average (SMMA), Standard Deviation, Stoller Average Range Channel (STARC) Bands, Stochastic Oscillator, Stochastic RSI, SuperTrend, Tillson T3 Moving Average, Triple Exponential Moving Average (TEMA), Triple EMA Oscillator (TRIX), True Strength Index (TSI), Ulcer Index, Ultimate Oscillator, Volume Simple Moving Average, Volume Weighted Average Price (VWAP), Vortex Indicator (VI), Weighted Moving Average (WMA), Williams %R, Williams Alligator, Williams Fractal, and Zig Zag.
Stars: ✭ 157 (-98.93%)
Mutual labels:  algorithmic-trading
Quant Notes
Quantitative Interview Preparation Guide, updated version here ==>
Stars: ✭ 180 (-98.78%)
Mutual labels:  quant
Openalgo
💹 openAlgo is a public repository for various work product relavant to algorithms and the high frequency low latency electronic trading space with a bias toward market microstructure as well as exchange traded futures and options.
Stars: ✭ 158 (-98.93%)
Mutual labels:  algorithmic-trading
Algorithmictrading
This repository contains three ways to obtain arbitrage which are Dual Listing, Options and Statistical Arbitrage. These are projects in collaboration with Optiver and have been peer-reviewed by staff members of Optiver.
Stars: ✭ 157 (-98.93%)
Mutual labels:  algorithmic-trading
Stock
30天掌握量化交易 (持续更新)
Stars: ✭ 2,966 (-79.84%)
Mutual labels:  quant
Zipline

Gitter pypi version status pypi pyversion status travis status appveyor status Coverage Status

Zipline is a Pythonic algorithmic trading library. It is an event-driven system for backtesting. Zipline is currently used in production as the backtesting and live-trading engine powering Quantopian -- a free, community-centered, hosted platform for building and executing trading strategies. Quantopian also offers a fully managed service for professionals that includes Zipline, Alphalens, Pyfolio, FactSet data, and more.

Features

  • Ease of Use: Zipline tries to get out of your way so that you can focus on algorithm development. See below for a code example.
  • "Batteries Included": many common statistics like moving average and linear regression can be readily accessed from within a user-written algorithm.
  • PyData Integration: Input of historical data and output of performance statistics are based on Pandas DataFrames to integrate nicely into the existing PyData ecosystem.
  • Statistics and Machine Learning Libraries: You can use libraries like matplotlib, scipy, statsmodels, and sklearn to support development, analysis, and visualization of state-of-the-art trading systems.

Installation

Zipline currently supports Python 2.7, 3.5, and 3.6, and may be installed via either pip or conda.

Note: Installing Zipline is slightly more involved than the average Python package. See the full Zipline Install Documentation for detailed instructions.

For a development installation (used to develop Zipline itself), create and activate a virtualenv, then run the etc/dev-install script.

Quickstart

See our getting started tutorial.

The following code implements a simple dual moving average algorithm.

from zipline.api import order_target, record, symbol

def initialize(context):
    context.i = 0
    context.asset = symbol('AAPL')


def handle_data(context, data):
    # Skip first 300 days to get full windows
    context.i += 1
    if context.i < 300:
        return

    # Compute averages
    # data.history() has to be called with the same params
    # from above and returns a pandas dataframe.
    short_mavg = data.history(context.asset, 'price', bar_count=100, frequency="1d").mean()
    long_mavg = data.history(context.asset, 'price', bar_count=300, frequency="1d").mean()

    # Trading logic
    if short_mavg > long_mavg:
        # order_target orders as many shares as needed to
        # achieve the desired number of shares.
        order_target(context.asset, 100)
    elif short_mavg < long_mavg:
        order_target(context.asset, 0)

    # Save values for later inspection
    record(AAPL=data.current(context.asset, 'price'),
           short_mavg=short_mavg,
           long_mavg=long_mavg)

You can then run this algorithm using the Zipline CLI. First, you must download some sample pricing and asset data:

$ zipline ingest
$ zipline run -f dual_moving_average.py --start 2014-1-1 --end 2018-1-1 -o dma.pickle --no-benchmark

This will download asset pricing data data sourced from Quandl, and stream it through the algorithm over the specified time range. Then, the resulting performance DataFrame is saved in dma.pickle, which you can load and analyze from within Python.

You can find other examples in the zipline/examples directory.

Questions?

If you find a bug, feel free to open an issue and fill out the issue template.

Contributing

All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. Details on how to set up a development environment can be found in our development guidelines.

If you are looking to start working with the Zipline codebase, navigate to the GitHub issues tab and start looking through interesting issues. Sometimes there are issues labeled as Beginner Friendly or Help Wanted.

Feel free to ask questions on the mailing list or on Gitter.

Note

Please note that Zipline is not a community-led project. Zipline is maintained by the Quantopian engineering team, and we are quite small and often busy.

Because of this, we want to warn you that we may not attend to your pull request, issue, or direct mention in months, or even years. We hope you understand, and we hope that this note might help reduce any frustration or wasted time.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].