For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Add % commission to the fractional size class
Tornar Yang last edited by
I have added the CommInfoFractional class to allow factional size but it overwrite my previous configuraiton of a % commission. How can I add a % commission to it?
class CommInfoFractional(bt.CommissionInfo): def getsize(self, price, cash): '''Returns fractional size for cash operation @price''' return self.p.leverage * (cash / price) cerebro.broker.addcommissioninfo(CommInfoFractional)