asset, 100 ) elif short_mavg < long_mavg : order_target ( context. i long_mavg : # order_target orders as many shares as needed to # achieve the desired number of shares. asset = symbol ( 'AAPL' ) def handle_data ( context, data ): # Skip first 300 days to get full windows context. from zipline.api import order_target, record, symbol def initialize ( context ): context. The following code implements a simple dual moving average algorithm. See the full Zipline Install Documentation for detailedįor a development installation (used to develop Zipline itself), create andĪctivate a virtualenv, then run the etc/dev-install script. Note: Installing Zipline is slightly more involved than the average Python Zipline currently supports Python 2.7, 3.5, and 3.6, and may be installed via Visualization of state-of-the-art trading systems. Statsmodels, and sklearn to support development, analysis, and Statistics and Machine Learning Libraries: You can use libraries like matplotlib, scipy, PyData Integration: Input of historical data and output of performance statistics areīased on Pandas DataFrames to integrate nicely into the existing Moving average and linear regression can be readily accessed from “Batteries Included”: many common statistics like Want to Contribute? See our Development GuidelinesĮase of Use: Zipline tries to get out of your way so that you canįocus on algorithm development. That includes Zipline, Alphalens, Pyfolio, FactSet data, and more. Quantopian also offers a fully managed service for professionals Zipline is currently used in production as the backtesting and live-tradingĬommunity-centered, hosted platform for building and executing trading Zipline is a Pythonic algorithmic trading library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |