Backtrader中可设定参数控制系统自动进行内存管理,在backtest 和live trade时可通过控制内存的方式在效率和存储容量之间寻找平衡。
exactbars 中参数设定可以对不同类型的数据设定存储容量,达到控制内存的效果。
- False: every value stored in a line is kept in memory
- True or 1: all “lines” objects reduce memory usage to the automatically calculated minimum period.
- -1: datas and indicators/operations at strategy level will keep all data in memory.
- -2: datas and indicators kept as attributes of the strategy will keep all data in memory.
网友评论