Skip to content

Commission

Commission is a big enough topic to deserve its own page. Between Commission and Slippage, it's often the difference between making a profit, or simply donating money to your broker.

Dejavu offers a few different commission structures.

dejavu.execution.commission.PerContractCommission

Bases: CommissionModel

This commission scheme takes a rate, percentage and applies it the order quantity. Most commonly would be used for Options contracts or derivatives.

__init__(rate=0.65)

Parameters:

Name Type Description Default
rate float
0.65

dejavu.execution.commission.PercentageOfNotionalCommission

Bases: CommissionModel

This commission structure takes a flat % of the total order value (pre-commission).

dejavu.execution.commission.TieredPerShareCommission

Bases: CommissionModel

This one models brokers such as Interactive Brokers, where there is a flat-fee or minimum, that is capped at a certain percentage of the trade's value.

Commission for different Asset Classes

Dejavu supports multiple asset classes, as such you may want to set different commission structures for different asset classes.

dejavu.execution.commission.AssetClassCommission

Bases: CommissionModel

This wrapper allows you to route different commission structures based on the asset classes.

The usage of it is relatively straight-froward:

commission_model = AssetClassCommission(
    models={
        AssetClass.EQUITY: TieredPerShareCommission(
            rate=0.005,
            minimum=1.00,
            max_pct_notional=0.01,
        ),
        AssetClass.OPTION: PerContractCommission(rate=0.65),
    },
    default=PerContractCommission(rate=0.65),
)

dejavu.execution.commission.SymbolCommission

Bases: CommissionModel

Per-symbol overrides, falls back to a default model.