contango.strategy.rule_based.position_sizers.allocation_position_sizer
contango.strategy.rule_based.position_sizers.allocation_position_sizer
AllocationPositionSizer
AllocationPositionSizer(allocation: float)
Bases: PositionSizer[TradingContext]
A position sizer with an allocation of the portfolio cash.
Initializes `FixedPositionSizer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
allocation
|
float
|
The allocation of the portfolio cash to trade. |
required |
Source code in src\contango\strategy\rule_based\position_sizers\allocation_position_sizer.py
11 12 13 14 15 16 17 18 | |
size
size(context: TradingContext) -> int
Returns the allocation percent of the portfolio cash (converted to units).
Source code in src\contango\strategy\rule_based\position_sizers\allocation_position_sizer.py
20 21 22 23 24 25 26 27 28 29 30 | |