contango.trading.execution.engine.fills.fill_policy
contango.trading.execution.engine.fills.fill_policy
FillPolicy
FillPolicy(rules: tuple[FillRule[T], ...])
Bases: Generic[T]
The policy for a certain mode of trading to pre-validate that all trading rules are met.
Initializes FillPolicy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rules
|
tuple[FillRule[T], ...]
|
An iterable of fill rules for the policy. |
required |
Source code in src\contango\trading\execution\engine\fills\fill_policy.py
15 16 17 18 19 20 21 22 | |
validate_rules
validate_rules(context: T) -> str | None
Validates all rules for the policy.
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The violation reason for the first violated rule, or |
Source code in src\contango\trading\execution\engine\fills\fill_policy.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |