backtrader中关于mult、leverage和margin的具体含义其实并没有百分之百的准则,CommInfoBase类里面的一些设置可能并不是完全合理,我们可以根据自己的需要,自己继承这个类,重写其中的一些方法。
以期货 百分比的佣金方式去举例子:
class ComminfoFuturesPercent(CommInfoBase):
'''write by myself,using in the future backtest,it means we should give a percent comminfo to broker'''
params = (
('stocklike', False),