Skip to content

MaximumSectorExposureRiskManagementModel

QuantConnect.Algorithm.Framework.Risk.MaximumSectorExposureRiskManagementModel

MaximumSectorExposureRiskManagementModel(
    maximum_sector_exposure: float = 0.2,
)

Bases: RiskManagementModel

Provides an implementation of IRiskManagementModel that limits the sector exposure to the specified percentage

Initializes a new instance of the MaximumSectorExposureRiskManagementModel class

Parameters:

Name Type Description Default
maximum_sector_exposure float

The maximum exposure for any sector, defaults to 20% sector exposure.

0.2

manage_risk

manage_risk(
    algorithm: QCAlgorithm, targets: List[IPortfolioTarget]
) -> Iterable[IPortfolioTarget]

Manages the algorithm's risk at each time step

Parameters:

Name Type Description Default
algorithm QCAlgorithm

The algorithm instance

required
targets List[IPortfolioTarget]

The current portfolio targets to be assessed for risk

required

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