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

How to define a commission scheme for Cryptos?

  • I'm trying to trade cryptos using backtrader, but the commission scheme is quite different.

    If the commission fee is 0.2%, which means if I buy 1btc, what I really get is 0.998btc. How can I define such commission scheme in backtrader?

  • administrators

    To Crypto or not to Crypto, that is the question. It's a simple mathematical operation.

    • size of asset a * commission in terms of a = size of asset b * 0.998

    You already know the size of asset b which is 1 and the price it has in size of asset a (your fiat currency), which means you can work out what the actual commission in fiat currency is.

    Obviously you do that for each operation by creating a custom sizer. Docs - User Defined Commissions