For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

question about futures margin



  • say i am trading soybean meal, some numbers:

    10 tons one lot

    3000$ one ton

    margin required 5%

    so one lot requires margin 3000 * 10 * 5% = 1500$

    but if i set commission as follows:

        cerebro.broker.setcommission(
            commission = 1.125,                     # 豆粕开仓1.5,平今0.75,单边平均1.125
            commtype = bt.CommInfoBase.COMM_FIXED,  # 固定手续费
            #percabs = True,                        # 这里用不到这个参数,当commtype是COMM_PERC时表示commission按照0.xx还是0.xx%计算
            automargin = 0.05,                      # 保证金10%
            mult = 10,                              # 豆粕一手10吨
            #stocklike = False,                      # 不是stock,而是futures
        )
    

    when executing self.buy(), log is:

    2019-03-19T13:00:02.403001 BUY EXECUTED, Price: 2608.00, Cost: 130.40, Comm 1.12
    

    should not it cost 2608 * 10 * 0.05=1304.0 but not 130.40 ?


  • administrators

    The multiplier affects your winnings and losses and not the needed margin.

    See Docs - Commission Schemes


Log in to reply
 

});