basana.backtesting.fees

Fee strategies are used by the backtesting exchange to support different trading fee schemes, or no fees at all.

class basana.backtesting.fees.FeeCurrency(value)

The currency in which fees are charged.

BASE = 'base'

Fees are charged in base currency.

QUOTE = 'quote'

Fees are charged in quote currency.

class basana.backtesting.fees.NoFee

Bases: FeeStrategy

This strategy applies no fees to the trades.

class basana.backtesting.fees.Percentage(percentage, min_fee=Decimal('0'), fee_currency=FeeCurrency.QUOTE)

Bases: FeeStrategy

This strategy applies a fixed percentage per trade.

Parameters:
  • percentage (Decimal) – The percentage to apply.

  • min_fee (Decimal) – Minimum fee amount, in the fee currency.

  • fee_currency (FeeCurrency) – The currency in which fees are charged. Defaults to FeeCurrency.QUOTE.