Lean  $LEAN_TAG$
QuantConnect.Lean.Engine.Results.IResultHandler Interface Reference

Handle the results of the backtest: where should we send the profit, portfolio updates: Backtester or the Live trading platform: More...

Inheritance diagram for QuantConnect.Lean.Engine.Results.IResultHandler:
[legend]

Public Member Functions

void OnSecuritiesChanged (SecurityChanges changes)
 Event fired each time that we add/remove securities from the data feed More...
 
void Initialize (ResultHandlerInitializeParameters parameters)
 Initialize the result handler with this result packet. More...
 
void DebugMessage (string message)
 Process debug messages with the preconfigured settings. More...
 
void SystemDebugMessage (string message)
 Process system debug messages with the preconfigured settings. More...
 
void SecurityType (List< SecurityType > types)
 Send a list of security types to the browser More...
 
void LogMessage (string message)
 Send a logging message to the log list for storage. More...
 
void ErrorMessage (string error, string stacktrace="")
 Send an error message back to the browser highlighted in red with a stacktrace. More...
 
void RuntimeError (string message, string stacktrace="")
 Send a runtime error message back to the browser highlighted with in red More...
 
void BrokerageMessage (BrokerageMessageEvent brokerageMessageEvent)
 Process brokerage message events More...
 
void Sample (DateTime time)
 Method to update the IResultHandler with various performance metrics. Called once a day by scheduled event in AlgorithmManager More...
 
void SetAlgorithm (IAlgorithm algorithm, decimal startingPortfolioValue)
 Set the algorithm of the result handler after its been initialized. More...
 
void SendStatusUpdate (AlgorithmStatus status, string message="")
 Send a algorithm status update to the user of the algorithms running state. More...
 
void RuntimeStatistic (string key, string value)
 Set a dynamic runtime statistic to show in the (live) algorithm header More...
 
void OrderEvent (OrderEvent newEvent)
 Send a new order event. More...
 
void Exit ()
 Terminate the result thread and apply any required exit procedures like sending final results. More...
 
void ProcessSynchronousEvents (bool forceProcess=false)
 Process any synchronous events in here that are primarily triggered from the algorithm loop More...
 
void SaveResults (string name, Result result)
 Save the results More...
 
void AlgorithmNameUpdated (string name)
 Handles updates to the algorithm's name More...
 
void AlgorithmTagsUpdated (HashSet< string > tags)
 Handles updates to the algorithm's tags More...
 
- Public Member Functions inherited from QuantConnect.Statistics.IStatisticsService
StatisticsResults StatisticsResults ()
 Calculates and gets the current statistics for the algorithm More...
 
void SetSummaryStatistic (string name, string value)
 Sets or updates a custom summary statistic More...
 

Properties

ConcurrentQueue< PacketMessages [get, set]
 Put messages to process into the queue so they are processed by this thread. More...
 
bool IsActive [get]
 Boolean flag indicating the result hander thread is busy. False means it has completely finished and ready to dispose. More...
 

Detailed Description

Handle the results of the backtest: where should we send the profit, portfolio updates: Backtester or the Live trading platform:

Definition at line 36 of file IResultHandler.cs.

Member Function Documentation

◆ OnSecuritiesChanged()

void QuantConnect.Lean.Engine.Results.IResultHandler.OnSecuritiesChanged ( SecurityChanges  changes)

Event fired each time that we add/remove securities from the data feed

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ Initialize()

void QuantConnect.Lean.Engine.Results.IResultHandler.Initialize ( ResultHandlerInitializeParameters  parameters)

Initialize the result handler with this result packet.

Parameters
parametersDTO parameters class to initialize a result handler

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.BacktestingResultHandler.

◆ DebugMessage()

void QuantConnect.Lean.Engine.Results.IResultHandler.DebugMessage ( string  message)

Process debug messages with the preconfigured settings.

Parameters
messageString debug message

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ SystemDebugMessage()

void QuantConnect.Lean.Engine.Results.IResultHandler.SystemDebugMessage ( string  message)

Process system debug messages with the preconfigured settings.

Parameters
messageString debug message

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ SecurityType()

void QuantConnect.Lean.Engine.Results.IResultHandler.SecurityType ( List< SecurityType types)

Send a list of security types to the browser

Parameters
typesSecurity types list inside algorithm

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ LogMessage()

void QuantConnect.Lean.Engine.Results.IResultHandler.LogMessage ( string  message)

Send a logging message to the log list for storage.

Parameters
messageMessage we'd in the log.

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ ErrorMessage()

void QuantConnect.Lean.Engine.Results.IResultHandler.ErrorMessage ( string  error,
string  stacktrace = "" 
)

Send an error message back to the browser highlighted in red with a stacktrace.

Parameters
errorError message we'd like shown in console.
stacktraceStacktrace information string

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ RuntimeError()

void QuantConnect.Lean.Engine.Results.IResultHandler.RuntimeError ( string  message,
string  stacktrace = "" 
)

Send a runtime error message back to the browser highlighted with in red

Parameters
messageError message.
stacktraceStacktrace information string

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

Here is the caller graph for this function:

◆ BrokerageMessage()

void QuantConnect.Lean.Engine.Results.IResultHandler.BrokerageMessage ( BrokerageMessageEvent  brokerageMessageEvent)

Process brokerage message events

Parameters
brokerageMessageEventThe brokerage message event

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.BacktestingResultHandler.

◆ Sample()

void QuantConnect.Lean.Engine.Results.IResultHandler.Sample ( DateTime  time)

Method to update the IResultHandler with various performance metrics. Called once a day by scheduled event in AlgorithmManager

Parameters
timeCurrent time

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler.

◆ SetAlgorithm()

void QuantConnect.Lean.Engine.Results.IResultHandler.SetAlgorithm ( IAlgorithm  algorithm,
decimal  startingPortfolioValue 
)

Set the algorithm of the result handler after its been initialized.

Parameters
algorithmAlgorithm object matching IAlgorithm interface
startingPortfolioValueAlgorithm starting capital for statistics calculations

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ SendStatusUpdate()

void QuantConnect.Lean.Engine.Results.IResultHandler.SendStatusUpdate ( AlgorithmStatus  status,
string  message = "" 
)

Send a algorithm status update to the user of the algorithms running state.

Parameters
statusStatus enum of the algorithm.
messageOptional string message describing reason for status change.

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.BacktestingResultHandler.

Here is the caller graph for this function:

◆ RuntimeStatistic()

void QuantConnect.Lean.Engine.Results.IResultHandler.RuntimeStatistic ( string  key,
string  value 
)

Set a dynamic runtime statistic to show in the (live) algorithm header

Parameters
keyRuntime headline statistic name
valueRuntime headline statistic value

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ OrderEvent()

void QuantConnect.Lean.Engine.Results.IResultHandler.OrderEvent ( OrderEvent  newEvent)

Send a new order event.

Parameters
newEventUpdate, processing or cancellation of an order, update the IDE in live mode or ignore in backtesting.

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ Exit()

void QuantConnect.Lean.Engine.Results.IResultHandler.Exit ( )

Terminate the result thread and apply any required exit procedures like sending final results.

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

Here is the caller graph for this function:

◆ ProcessSynchronousEvents()

void QuantConnect.Lean.Engine.Results.IResultHandler.ProcessSynchronousEvents ( bool  forceProcess = false)

Process any synchronous events in here that are primarily triggered from the algorithm loop

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ SaveResults()

void QuantConnect.Lean.Engine.Results.IResultHandler.SaveResults ( string  name,
Result  result 
)

Save the results

Parameters
nameThe name of the results
resultThe results to save

Implemented in QuantConnect.Lean.Engine.Results.RegressionResultHandler.

◆ AlgorithmNameUpdated()

void QuantConnect.Lean.Engine.Results.IResultHandler.AlgorithmNameUpdated ( string  name)

Handles updates to the algorithm's name

Parameters
nameThe new name

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.BacktestingResultHandler.

◆ AlgorithmTagsUpdated()

void QuantConnect.Lean.Engine.Results.IResultHandler.AlgorithmTagsUpdated ( HashSet< string >  tags)

Handles updates to the algorithm's tags

Parameters
tagsThe new tags

Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.BacktestingResultHandler.

Property Documentation

◆ Messages

ConcurrentQueue<Packet> QuantConnect.Lean.Engine.Results.IResultHandler.Messages
getset

Put messages to process into the queue so they are processed by this thread.

Definition at line 42 of file IResultHandler.cs.

◆ IsActive

bool QuantConnect.Lean.Engine.Results.IResultHandler.IsActive
get

Boolean flag indicating the result hander thread is busy. False means it has completely finished and ready to dispose.

Definition at line 52 of file IResultHandler.cs.


The documentation for this interface was generated from the following file: