class qf_lib.backtesting.position_sizer.fixed_portfolio_percentage_position_sizer.FixedPortfolioPercentagePositionSizer(broker:, data_provider: qf_lib.data_providers.data_provider.DataProvider, order_factory: qf_lib.backtesting.order.order_factory.OrderFactory, signals_register: qf_lib.backtesting.signals.signals_register.SignalsRegister, fixed_percentage: float, tolerance_percentage: float = 0.0)[source]

Bases: qf_lib.backtesting.position_sizer.position_sizer.PositionSizer

This PositionSizer converts signals to orders using Fixed Percentage value. Each signal will be sized based on that percentage of the portfolio.

  • broker (Broker) –

  • data_provider (DataProvider) –

  • order_factory (OrderFactory) –

  • fixed_percentage (float) – should be set once for all signals. It corresponds to the fraction of a portfolio that we are investing in every asset on single trade. For example: fixed_percentage = 0.2, means that we are investing 20% of portfolio to any signal that is long or short.

  • tolerance_percentage (float) – used by OrderFactory