Enter the pit backtrader, or enter the pit...? Choose difficulties to relieve worries

There are many open source quantitative backtesting and trading frameworks on the market, and many friends do not know how to choose. I have also seen many. So far, backtrader is the most concise and elegant framework for writing strategies that I have seen. For the same thing, he often has the least amount of code.

1 Unified and concise strategy writing mode

You can observe the single-share and multi-share implementation of the classic double moving average strategy in the link below:

Sweeping monk backtrader powerful tutorial series

It can be seen that single-strand and multi-strand are compiled in a unified mode, unlike some frames where single-strand and multi-strand require two different templates, which is very inelegant.

If you want to compare and evaluate other frameworks, you can see how neat they implement these two strategies, especially the multi-share strategy.

 

2 Vectorization index calculation

In addition, backtrader uses vectorized calculations for indicator calculations instead of loops, which is an order of magnitude faster than some frameworks.

 

3 Quick entry

How to get into backtrader quickly?

Practice as soon as possible, grasp the core at the beginning, get started as soon as possible, and don't be disturbed by side details.

Many quantitative framework documents, including backtrader documents, do not seem to understand this point. Understand the core, and then understand the peripheral details later, there will be no problem.

Therefore, my tutorials will be carefully designed, starting from the simplest and most core place, and try not to interfere with side details, so that it is quick to learn and get started. Once you get started, it's easy to handle later. Beginners should also learn with this attitude and thinking.

The fastest way to enter the pit of backtrader is to run the source code examples in my sample book for free with the video. Both the video and the source code of the sample book can be found at the following link, try it yourself

Backtrader Sweeping Monk official website  or  here

 

(Note: If you are good at English and are willing to spend a long time thinking about it, then you can refer to the Backtrader document. However, it should be noted that the English document does not mention the concept of strategy iteration table, which is the core of understanding the entire backtrader strategy, especially multi-share The concept of the strategy iteration table is only explained in my sweeping monk tutorial. If you don’t understand this, you can’t understand the logic of multi-share strategy writing, and you will definitely fall into the pit.)

Guess you like

Origin blog.csdn.net/qtbgo/article/details/113459362