Lean  $LEAN_TAG$
QuantConnect.Lean.Engine.Setup.BaseSetupHandler Class Reference

Base class that provides shared code for the ISetupHandler implementations More...

Static Public Member Functions

static bool Setup (SetupHandlerParameters parameters)
 Primary entry point to setup a new algorithm More...
 
static void SetupCurrencyConversions (IAlgorithm algorithm, UniverseSelection universeSelection, IReadOnlyCollection< string > currenciesToUpdateWhiteList=null)
 Will first check and add all the required conversion rate securities and later will seed an initial value to them. More...
 
static bool InitializeDebugging (AlgorithmNodePacket algorithmNodePacket, WorkerThread workerThread)
 Initialize the debugger More...
 
static void LoadBacktestJobCashAmount (IAlgorithm algorithm, BacktestNodePacket job)
 Sets the initial cash for the algorithm if set in the job packet. More...
 
static void LoadBacktestJobAccountCurrency (IAlgorithm algorithm, BacktestNodePacket job)
 Sets the account currency the algorithm should use if set in the job packet More...
 
static Dictionary< SecurityType, List< TickType > > GetConfiguredDataFeeds ()
 Get the available data feeds from config.json, More...
 
static void SetBrokerageTradingDayPerYear (IAlgorithm algorithm)
 Set the number of trading days per year based on the specified brokerage model. More...
 

Properties

static TimeSpan AlgorithmCreationTimeout = TimeSpan.FromSeconds(Config.GetDouble("algorithm-creation-timeout", 90)) [get]
 Get the maximum time that the creation of an algorithm can take More...
 

Detailed Description

Base class that provides shared code for the ISetupHandler implementations

Definition at line 41 of file BaseSetupHandler.cs.

Member Function Documentation

◆ Setup()

static bool QuantConnect.Lean.Engine.Setup.BaseSetupHandler.Setup ( SetupHandlerParameters  parameters)
static

Primary entry point to setup a new algorithm

Parameters
parametersThe parameters object to use
Returns
True on successfully setting up the algorithm state, or false on error.

Definition at line 53 of file BaseSetupHandler.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupCurrencyConversions()

static void QuantConnect.Lean.Engine.Setup.BaseSetupHandler.SetupCurrencyConversions ( IAlgorithm  algorithm,
UniverseSelection  universeSelection,
IReadOnlyCollection< string >  currenciesToUpdateWhiteList = null 
)
static

Will first check and add all the required conversion rate securities and later will seed an initial value to them.

Parameters
algorithmThe algorithm instance
universeSelectionThe universe selection instance
currenciesToUpdateWhiteListIf passed, the currencies in the CashBook that are contained in this list will be updated. By default, if not passed (null), all currencies in the cashbook without a properly set up currency conversion will be updated. This is not intended for actual algorithms but for tests or for this method to be used as a helper.

Definition at line 77 of file BaseSetupHandler.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeDebugging()

static bool QuantConnect.Lean.Engine.Setup.BaseSetupHandler.InitializeDebugging ( AlgorithmNodePacket  algorithmNodePacket,
WorkerThread  workerThread 
)
static

Initialize the debugger

Parameters
algorithmNodePacketThe algorithm node packet
workerThreadThe worker thread instance to use

Definition at line 197 of file BaseSetupHandler.cs.

Here is the caller graph for this function:

◆ LoadBacktestJobCashAmount()

static void QuantConnect.Lean.Engine.Setup.BaseSetupHandler.LoadBacktestJobCashAmount ( IAlgorithm  algorithm,
BacktestNodePacket  job 
)
static

Sets the initial cash for the algorithm if set in the job packet.

Should be called after initialize LoadBacktestJobAccountCurrency

Definition at line 219 of file BaseSetupHandler.cs.

Here is the call graph for this function:

◆ LoadBacktestJobAccountCurrency()

static void QuantConnect.Lean.Engine.Setup.BaseSetupHandler.LoadBacktestJobAccountCurrency ( IAlgorithm  algorithm,
BacktestNodePacket  job 
)
static

Sets the account currency the algorithm should use if set in the job packet

Should be called before initialize LoadBacktestJobCashAmount

Definition at line 238 of file BaseSetupHandler.cs.

Here is the call graph for this function:

◆ GetConfiguredDataFeeds()

static Dictionary<SecurityType, List<TickType> > QuantConnect.Lean.Engine.Setup.BaseSetupHandler.GetConfiguredDataFeeds ( )
static

Get the available data feeds from config.json,

Definition at line 250 of file BaseSetupHandler.cs.

Here is the call graph for this function:

◆ SetBrokerageTradingDayPerYear()

static void QuantConnect.Lean.Engine.Setup.BaseSetupHandler.SetBrokerageTradingDayPerYear ( IAlgorithm  algorithm)
static

Set the number of trading days per year based on the specified brokerage model.

Parameters
algorithmThe algorithm instance
Returns
The number of trading days per year. For specific brokerages (Coinbase, Binance, Bitfinex, Bybit, FTX, Kraken), the value is 365. For other brokerages, the default value is 252.

Definition at line 271 of file BaseSetupHandler.cs.

Here is the caller graph for this function:

Property Documentation

◆ AlgorithmCreationTimeout

TimeSpan QuantConnect.Lean.Engine.Setup.BaseSetupHandler.AlgorithmCreationTimeout = TimeSpan.FromSeconds(Config.GetDouble("algorithm-creation-timeout", 90))
staticget

Get the maximum time that the creation of an algorithm can take

Definition at line 46 of file BaseSetupHandler.cs.


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