Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
Quantopian — The Online Algo Trading Platform
Quantopian is one of the most popular online algo trading platforms and communities today. It provides the great backtesting environment where you can experiment with your idea, build algorithms and even participate in the contest, as well as share the idea and discuss it with smart people there.
One of the things many people have asked Alpaca during the beta program is how to run the algorithms that they built in Quantopian platform for their own purpose, not just for the contest. While Quantopian has built so much in the platform, they are so great to share the internal framework as open source zipline.
The Newest Open Source Libraries for Quantopian Users
Today, I wanted to share our newest open source libraries for Quantopian users; pylivetrader and pipeline-live.
pylivetrader is a zipline API compatible trading framework in python which again focuses on live trading, with much less overhead and dependency problems. It is written from the ground up for live trading use cases, so it removes a lot of heavy lifting that zipline had to do such as price adjustment etc.
This means, you don’t need to build your data bundle to kick off your algorithm in live, but instead you can just start your live trading from the Quantopian algorithm source right away.
At the moment, the supported backend is only Alpaca, but we are happy to connect to IB etc. if someone contributes the code.
Pipeline API — the Core Piece of Quantopian Framework
Pipeline API is the core piece of Quantopian algorithm framework that allows easy stock selection based on the different metrics, much in a pythonic way, and this differentiates the platform from others. I found Pipeline is providing a tremendous value when it comes to trading wide range of universe. Unfortunately, it is not so easy for most people to use this great feature outside of the Quantopian platform.
pipeline-live is a python tool that allows you to do something similar anywhere so that you can do your research somewhere else as well as use it with existing python trading framework such as zipline-live or backtrader, including pylivetrader which I am introducing below. pipeline-live primarily uses IEX public API for pricing and basic fundamental information.
As you know, IEX provides market-wide volume data for daily OHLCV which makes it a perfect choice for pipeline usage. Since pipeline-live focuses on live trading use cases, it does not provide historical view unlike inside Quantopian, but the upside is it is fairly independent and easy to use. It is also very extensible so you can hook up with other paid data sources if you would find useful.
How to Convert Your Quantopian Algorithms to Run in Live Trading
We also put some practices together about how you could convert your Quantopian algorithms to run in live trading. You may want to take a look at these documents if you are interested in.
https://github.com/alpacahq/pipeline-live/blob/master/migration.mdhttps://github.com/alpacahq/pylivetrader/blob/master/migration.md
I also posted in Quantopian forum with the real example, and you may take a look at it, too.
Long-only non-day trading algorithm for live
Feel free to give me any feedback/questions/criticism. Happy to help you get started with live trading with these tools too.
Below is the example code migrated from the post above.
Thanks for reading! If you’re a developer, and believe you can code your way to financial freedom, please support our project “a commission-free stock brokerage for developers and bots” by joining the waitlist!
Brokerage services are provided by Alpaca Securities LLC (alpaca.markets), member FINRA/SIPC. Alpaca Securities LLC is a wholly-owned subsidiary of AlpacaDB, Inc.
You can find us @AlpacaHQ, if you use twitter.
Python Library To Run Quantopian Algorithm In Live was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.