AlphaStreamsPortfolioConstructionModel
QuantConnect.Algorithm.Framework.Portfolio.AlphaStreamsPortfolioConstructionModel
Bases: Object, IPortfolioConstructionModel
Base alpha streams portfolio construction model
create_targets
create_targets(
algorithm: QCAlgorithm, insights: List[Insight]
) -> Iterable[IPortfolioTarget]
Create portfolio targets from the specified insights
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
algorithm
|
QCAlgorithm
|
The algorithm instance |
required |
insights
|
List[Insight]
|
The insights to create portfolio targets from |
required |
Returns:
| Type | Description |
|---|---|
Iterable[IPortfolioTarget]
|
An enumerable of portfolio targets to be sent to the execution model. |
get_alpha_weight
get_alpha_weight(alpha_id: str) -> float
Get's the weight for an alpha
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha_id
|
str
|
The algorithm instance that experienced the change in securities |
required |
Returns:
| Type | Description |
|---|---|
float
|
The alphas weight. |
on_securities_changed
on_securities_changed(
algorithm: QCAlgorithm, changes: SecurityChanges
) -> None
Event fired each time the we add/remove securities from the data feed
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
algorithm
|
QCAlgorithm
|
The algorithm instance that experienced the change in securities |
required |
changes
|
SecurityChanges
|
The security additions and removals from the algorithm |
required |