Skip to content

Backtest

QuantConnect.Api.Backtest

Backtest()

Bases: BasicBacktest

Results object class. Results are exhaust from backtest or live algorithms running in LEAN

JSON Constructor

note

note: str

Note on the backtest attached by the user

completed

completed: bool

Boolean true when the backtest is completed.

organization_id

organization_id: str

Organization ID

rolling_window

rolling_window: Dictionary[str, AlgorithmPerformance]

Rolling window detailed statistics.

total_performance

total_performance: AlgorithmPerformance

Total algorithm performance statistics.

charts

charts: IDictionary[str, Chart]

Charts updates for the live algorithm since the last result packet

statistics

statistics: IDictionary[str, str]

Statistics information sent during the algorithm operations.

runtime_statistics

runtime_statistics: IDictionary[str, str]

Runtime banner/updating statistics in the title banner of the live algorithm GUI.

research_guide

research_guide: ResearchGuide

A power gauge for backtests, time and parameters to estimate the overfitting risk

backtest_start

backtest_start: Optional[datetime]

The starting time of the backtest

backtest_end

backtest_end: Optional[datetime]

The ending time of the backtest

has_initialize_error

has_initialize_error: bool

Indicates if the backtest has error during initialization

node_name

node_name: str

The backtest node name

project_id

project_id: int

The associated project id

out_of_sample_max_end_date

out_of_sample_max_end_date: Optional[datetime]

End date of out of sample data

out_of_sample_days

out_of_sample_days: Optional[int]

Number of days of out of sample days

success

success: bool

Indicate if the API request was successful.

errors

errors: List[str]

List of errors with the API call.

error

error: str

Backtest error message

stacktrace

stacktrace: str

Backtest error stacktrace

backtest_id

backtest_id: str

Assigned backtest Id

status

status: str

Status of the backtest

name

name: str

Name of the backtest

created

created: datetime

Backtest creation date and time

progress

progress: float

Progress of the backtest in percent 0-1.

optimization_id

optimization_id: str

Optimization task ID, if the backtest is part of an optimization

tradeable_dates

tradeable_dates: int

Number of tradeable days

parameter_set

parameter_set: ParameterSet

Optimization parameters

snap_shot_id

snap_shot_id: int

Snapshot id of this backtest result

to_string

to_string() -> str

Returns the string representation of this object