Lean
$LEAN_TAG$
|
Handle the results of the backtest: where should we send the profit, portfolio updates: Backtester or the Live trading platform: More...
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< Packet > | Messages [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... | |
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.
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.
void QuantConnect.Lean.Engine.Results.IResultHandler.Initialize | ( | ResultHandlerInitializeParameters | parameters | ) |
Initialize the result handler with this result packet.
parameters | DTO parameters class to initialize a result handler |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.BacktestingResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.DebugMessage | ( | string | message | ) |
Process debug messages with the preconfigured settings.
message | String debug message |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.SystemDebugMessage | ( | string | message | ) |
Process system debug messages with the preconfigured settings.
message | String debug message |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.SecurityType | ( | List< SecurityType > | types | ) |
Send a list of security types to the browser
types | Security types list inside algorithm |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.LogMessage | ( | string | message | ) |
Send a logging message to the log list for storage.
message | Message we'd in the log. |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.
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.
error | Error message we'd like shown in console. |
stacktrace | Stacktrace information string |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.RuntimeError | ( | string | message, |
string | stacktrace = "" |
||
) |
Send a runtime error message back to the browser highlighted with in red
message | Error message. |
stacktrace | Stacktrace information string |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.BrokerageMessage | ( | BrokerageMessageEvent | brokerageMessageEvent | ) |
Process brokerage message events
brokerageMessageEvent | The brokerage message event |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.BacktestingResultHandler.
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
time | Current time |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.SetAlgorithm | ( | IAlgorithm | algorithm, |
decimal | startingPortfolioValue | ||
) |
Set the algorithm of the result handler after its been initialized.
algorithm | Algorithm object matching IAlgorithm interface |
startingPortfolioValue | Algorithm starting capital for statistics calculations |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.SendStatusUpdate | ( | AlgorithmStatus | status, |
string | message = "" |
||
) |
Send a algorithm status update to the user of the algorithms running state.
status | Status enum of the algorithm. |
message | Optional string message describing reason for status change. |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.BacktestingResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.RuntimeStatistic | ( | string | key, |
string | value | ||
) |
Set a dynamic runtime statistic to show in the (live) algorithm header
key | Runtime headline statistic name |
value | Runtime headline statistic value |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, QuantConnect.Lean.Engine.Results.BacktestingResultHandler, and QuantConnect.Lean.Engine.Results.RegressionResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.OrderEvent | ( | OrderEvent | newEvent | ) |
Send a new order event.
newEvent | Update, 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.
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.
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.
void QuantConnect.Lean.Engine.Results.IResultHandler.SaveResults | ( | string | name, |
Result | result | ||
) |
Save the results
name | The name of the results |
result | The results to save |
Implemented in QuantConnect.Lean.Engine.Results.RegressionResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.AlgorithmNameUpdated | ( | string | name | ) |
Handles updates to the algorithm's name
name | The new name |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.BacktestingResultHandler.
void QuantConnect.Lean.Engine.Results.IResultHandler.AlgorithmTagsUpdated | ( | HashSet< string > | tags | ) |
Handles updates to the algorithm's tags
tags | The new tags |
Implemented in QuantConnect.Lean.Engine.Results.LiveTradingResultHandler, and QuantConnect.Lean.Engine.Results.BacktestingResultHandler.
|
getset |
Put messages to process into the queue so they are processed by this thread.
Definition at line 42 of file IResultHandler.cs.
|
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.