VolumeOrdersFilter

class qf_lib.backtesting.orders_filter.volume_orders_filter.VolumeOrdersFilter(data_provider: DataProvider, volume_percentage_limit: float)[source]

Bases: OrdersFilter

Verifies whether the orders sizes do not exceed the given volume limit.

Parameters:
  • data_provider (DataProvider) – used to download the volume data

  • volume_percentage_limit (float) – defines the maximum percentage of the volume value, that the orders size should not exceed

Methods:

adjust_orders(orders)

Takes list of orders and based on them creates a new list with orders, whose size does not to exceed the given volume limits.

adjust_orders(orders: List[Order]) List[Order][source]

Takes list of orders and based on them creates a new list with orders, whose size does not to exceed the given volume limits. The Orders are changed in place.

Parameters:

orders (List[Order]) – list of orders to adjust

Returns:

list of orders, that do not exceed the given volume percentage limit

Return type:

List[Order]