Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to develop quantitative transaction back testing Framework based on python

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you about how to develop a quantitative transaction back testing framework based on python. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.

Write at the front

In the development of quantitative strategy, strategy backtesting is essential, although there are many quantitative backtesting platforms such as the three major mines that can help us to carry out strategic development and backtesting. However, with the help of other people's platform, there are some disadvantages, such as unable to understand the backtesting process, unable to study the details of policy implementation, unable to use local data for testing, or policy security, and so on. In addition to building your own backtesting framework, you can also choose to use some existing backtesting frameworks for localized development. This paper introduces several famous quantitative back testing frameworks at home and abroad, and they are all developed based on python.

Zipline

Zipline is a quantitative trading library developed and maintained by quantopian, a famous quantitative strategy platform in the United States, and the back test engine of quantopian quantitative platform is also based on zipline. In addition, it is also based on the three famous back test engines such as JointQuant, RiceQuant and Youkuang in China. In addition, due to the use of the quantopian platform for many years, the professionalism of zipline can be guaranteed, and the code of zipline in github is constantly updated and improved.

Zipline is an event-driven (event-driven) backtesting framework with complete documentation and community. If you are interested in foreign US stock trading, then zipline will be more appropriate; however, domestic data like A-shares cannot be supported, and can only be tested back through localized data.

Zipline's tutorial can refer to its official tutorial: https://www.zipline.io/beginner-tutorial or Gitbook's Chinese tutorial: https://rainx.gitbooks.io/-zipline/content/

PyAlgoTrade

Insert a picture here to describe that pyalgotrade is also an event-driven backtesting framework, which is not as famous as zipline, but also has a complete community and detailed documentation. It is said that pyalgotrade is faster and more flexible than zipline, but the disadvantage is that it does not support pandas. Pyalgotrade's tutoral can refer to its official tutorial: http://gbeced.github.io/pyalgotrade/docs/v0.20/html/tutorial.html

BackTrader

Backtrader is a powerful quantitative policy testing platform, and it has been keeping the code updated on github in recent years. For learning about backtrader, please refer to backtrader's official document: https://www.backtrader.com/docu/.

Catalyst

In recent years, due to the demand for virtual currency transactions, there are many quantitative back test platforms for virtual currency transactions. Catalyst is an underlying zipline-based algorithm trading framework, which is relatively mature at present, and can support strategy back-testing and firm trading (currently supports four exchanges Binance, Bitfinex, Bittrex, Poloniex). Its official tutorial is: https://enigma.co/catalyst/

Vn.py

Vn.py is a domestic quantitative trading framework developed by Chen Xiaoyou boss team. at present, the number of star and fork on github has exceeded that of zipline, and it is currently the first open source quantitative framework in the world, which is indeed a thing to be proud of. In addition, vn.py mainly focuses on firm trading, and also supports back testing through historical data, including data visualization, return results, parameter tuning, etc., in addition, it also has some commonly used CTA strategies, SpreadTrading spread trading, market recording and other functions, and it also has a complete community and tutorials. Beginners can use its GUI environment VN Station when using it, and can also customize policy development based on its policy template. For learning about vnpy, you can refer to its official tutorial: https://www.vnpy.com/docs/cn/index.html.

Finally, it doesn't make sense to ask which is the best and which is the worst between backtesting frameworks. You don't need to learn and use them all (of course, if you need to develop a retesting framework, you can also learn from some of the details and logic they developed). If it is only used for local testing, choose a framework that best suits your needs.

The above is the editor for you to share how to develop a quantitative transaction back testing framework based on python, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report