quantlab.execution.rules.ExecutionSettings#

class quantlab.execution.rules.ExecutionSettings(sizing_basis='fill', fees=0.0, slippage=0.0)[source]#

Bases: object

How orders are sized and charged.

Parameters:
sizing_basis{“fill”, “valuation”}

The prices a weight is sized against: the fill bar’s order prices, or the signal bar’s valuation prices.

feesfloat

The fee, a fraction of each order’s traded value.

slippagefloat

The fraction a fill price moves against the trade.

Raises:
ValueError

If sizing_basis is neither "fill" nor "valuation".

Examples

>>> ExecutionSettings()
ExecutionSettings(sizing_basis='fill', fees=0.0, slippage=0.0)
>>> ExecutionSettings(sizing_basis="close")
Traceback (most recent call last):
...
ValueError: sizing_basis must be one of ('fill', 'valuation'), got 'close'