contango.trading.execution.backtest.fill_behavior.rules.pyramiding_rule
contango.trading.execution.backtest.fill_behavior.rules.pyramiding_rule
PyramidingRule
Bases: FillRule[RuleContext]
Rule that does not allow two subsequent positive orders.
validate
validate(context: RuleContext) -> bool
Returns True upon correctly selling shares when the last order was a buy.
Source code in src\contango\trading\execution\backtest\fill_behavior\rules\pyramiding_rule.py
15 16 17 18 19 20 21 22 | |