【答读者问49】backtrader中的mult、leverage、margin的关系

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),

猜你喜欢

转载自blog.csdn.net/qq_26948675/article/details/124851580