contango.strategy.rule_based.position_sizers.fixed_position_sizer
contango.strategy.rule_based.position_sizers.fixed_position_sizer
FixedPositionSizer
FixedPositionSizer(fixed_units: int)
Bases: PositionSizer[TradingContext]
A position sizer with a fixed amount of units.
Initializes `FixedPositionSizer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixed_units
|
int
|
The unchanging amount of units to order for every trade. |
required |
Source code in src\contango\strategy\rule_based\position_sizers\fixed_position_sizer.py
11 12 13 14 15 16 17 18 | |
size
size(context: TradingContext) -> int
Returns the fixed size set during initialization.
Source code in src\contango\strategy\rule_based\position_sizers\fixed_position_sizer.py
20 21 22 23 24 | |