|
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... | |
| virtual 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 | |
| TimeSpan | InitializationTimeOut = TimeSpan.FromMinutes(5) [get, set] |
| Get the maximum time that the initialization of an algorithm can take More... | |
| TimeSpan | AlgorithmCreationTimeout = BaseSetupHandler.AlgorithmCreationTimeout [get, set] |
| Get the maximum time that the creation of an algorithm can take More... | |
| 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 84 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 97 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 125 of file BacktestingSetupHandler.cs.
|
virtual |
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 136 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 273 of file BacktestingSetupHandler.cs.
|
getsetprotected |
Get the maximum time that the initialization of an algorithm can take
Definition at line 39 of file BacktestingSetupHandler.cs.
|
getsetprotected |
Get the maximum time that the creation of an algorithm can take
Definition at line 44 of file BacktestingSetupHandler.cs.
|
getset |
The worker thread instance the setup handler should use
Definition at line 49 of file BacktestingSetupHandler.cs.
|
getset |
Internal errors list from running the setup procedures.
Definition at line 54 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 60 of file BacktestingSetupHandler.cs.
|
getprotected set |
Starting capital according to the users initialize routine.
Set from the user code.
Definition at line 67 of file BacktestingSetupHandler.cs.
|
getprotected set |
Start date for analysis loops to search for data.
Definition at line 73 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 79 of file BacktestingSetupHandler.cs.