Skip to content

PortfolioValueIsNotPositiveAnalysis

QuantConnect.Lean.Engine.Results.Analysis.Analyses.PortfolioValueIsNotPositiveAnalysis

Bases: BaseResultsAnalysis

Flags backtests whose ending equity is zero or negative.

issue

issue: str

Gets the description of the non-positive portfolio equity issue.

weight

weight: int

Gets the severity weight for this portfolio value analysis.

run

run(
    parameters: ResultsAnalysisRunParameters,
) -> Sequence[Analysis]
run(result: Result) -> Sequence[Analysis]

Signature descriptions:

  • Runs the portfolio value positivity analysis against the provided backtest parameters.

  • Checks whether the backtest's ending equity is positive.

Parameters:

Name Type Description Default
result Optional[Result]

The backtest result containing portfolio statistics.

None

Returns:

Type Description
Sequence[Analysis]

Analysis results flagging the issue when ending equity is zero or negative.

single_response

single_response(
    sample: Any, solutions: Sequence[str] = None
) -> Sequence[Analysis]
single_response(
    sample: Any,
    count: Optional[int],
    solutions: Sequence[str] = None,
) -> Sequence[Analysis]

Wraps a single QuantConnect.Analysis in a one-element read-only list.

create_aggregated_response

create_aggregated_response(
    responses: List[Analysis],
) -> Sequence[Analysis]

Filters responses to those with solutions, prefixes the class name, and returns a flat list.

This codeEntityType is protected.

format_code

format_code(code: str, language: Language) -> str

Formats the specified code string according to the conventions of the given programming language.

This codeEntityType is protected.