Lean
$LEAN_TAG$
|
Backtesting setup handler processes the algorithm initialize method and sets up the internal state of the algorithm class. More...
Public Member Functions | |
BacktestingSetupHandler () | |
Initialize the backtest setup handler. More... | |
virtual IAlgorithm | CreateAlgorithmInstance (AlgorithmNodePacket algorithmNodePacket, string assemblyPath) |
Create a new instance of an algorithm from a physical dll path. More... | |
virtual IBrokerage | CreateBrokerage (AlgorithmNodePacket algorithmNodePacket, IAlgorithm uninitializedAlgorithm, out IBrokerageFactory factory) |
Creates a new BacktestingBrokerage instance More... | |
bool | Setup (SetupHandlerParameters parameters) |
Setup the algorithm cash, dates and data subscriptions as desired. More... | |
void | Dispose () |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
Properties | |
WorkerThread | WorkerThread [get, set] |
The worker thread instance the setup handler should use More... | |
List< Exception > | Errors [get, set] |
Internal errors list from running the setup procedures. More... | |
TimeSpan | MaximumRuntime [get, protected set] |
Maximum runtime of the algorithm in seconds. More... | |
decimal | StartingPortfolioValue [get, protected set] |
Starting capital according to the users initialize routine. More... | |
DateTime | StartingDate [get, protected set] |
Start date for analysis loops to search for data. More... | |
int | MaxOrders [get, protected set] |
Maximum number of orders for this backtest. More... | |
Properties inherited from QuantConnect.Lean.Engine.Setup.ISetupHandler | |
WorkerThread | WorkerThread [set] |
The worker thread instance the setup handler should use More... | |
List< Exception > | Errors [get, set] |
Any errors from the initialization stored here: More... | |
TimeSpan | MaximumRuntime [get] |
Get the maximum runtime for this algorithm job. More... | |
decimal | StartingPortfolioValue [get] |
Algorithm starting capital for statistics calculations More... | |
DateTime | StartingDate [get] |
Start date for analysis loops to search for data. More... | |
int | MaxOrders [get] |
Maximum number of orders for the algorithm run – applicable for backtests only. More... | |
Backtesting setup handler processes the algorithm initialize method and sets up the internal state of the algorithm class.
Definition at line 34 of file BacktestingSetupHandler.cs.
QuantConnect.Lean.Engine.Setup.BacktestingSetupHandler.BacktestingSetupHandler | ( | ) |
Initialize the backtest setup handler.
Definition at line 74 of file BacktestingSetupHandler.cs.
|
virtual |
Create a new instance of an algorithm from a physical dll path.
assemblyPath | The path to the assembly's location |
algorithmNodePacket | Details of the task required |
Implements QuantConnect.Lean.Engine.Setup.ISetupHandler.
Definition at line 87 of file BacktestingSetupHandler.cs.
|
virtual |
Creates a new BacktestingBrokerage instance
algorithmNodePacket | Job packet |
uninitializedAlgorithm | The algorithm instance before Initialize has been called |
factory | The brokerage factory |
Implements QuantConnect.Lean.Engine.Setup.ISetupHandler.
Definition at line 115 of file BacktestingSetupHandler.cs.
bool QuantConnect.Lean.Engine.Setup.BacktestingSetupHandler.Setup | ( | SetupHandlerParameters | parameters | ) |
Setup the algorithm cash, dates and data subscriptions as desired.
parameters | The parameters object to use |
Implements QuantConnect.Lean.Engine.Setup.ISetupHandler.
Definition at line 126 of file BacktestingSetupHandler.cs.
void QuantConnect.Lean.Engine.Setup.BacktestingSetupHandler.Dispose | ( | ) |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
<filterpriority>2</filterpriority>
Definition at line 258 of file BacktestingSetupHandler.cs.
|
getset |
The worker thread instance the setup handler should use
Definition at line 39 of file BacktestingSetupHandler.cs.
|
getset |
Internal errors list from running the setup procedures.
Definition at line 44 of file BacktestingSetupHandler.cs.
|
getprotected set |
Maximum runtime of the algorithm in seconds.
Maximum runtime is a formula based on the number and resolution of symbols requested, and the days backtesting
Definition at line 50 of file BacktestingSetupHandler.cs.
|
getprotected set |
Starting capital according to the users initialize routine.
Set from the user code.
Definition at line 57 of file BacktestingSetupHandler.cs.
|
getprotected set |
Start date for analysis loops to search for data.
Definition at line 63 of file BacktestingSetupHandler.cs.
|
getprotected set |
Maximum number of orders for this backtest.
To stop algorithm flooding the backtesting system with hundreds of megabytes of order data we limit it to 100 per day
Definition at line 69 of file BacktestingSetupHandler.cs.