Class DataSource
Helper class to load asset data from various data feeds.
Inherited Members
Namespace: TuringTrader.SimulatorV2
Assembly: TuringTrader.Simulator.dll
Syntax
public static class DataSource
Fields
| Edit this page View Source_lockGetData
Declaration
public static object _lockGetData
Field Value
Type | Description |
---|---|
object |
_lockGetMeta
Declaration
public static object _lockGetMeta
Field Value
Type | Description |
---|---|
object |
_lockNorgate
Object to block reentrance into Norgate APIs. This object is made public to interface between code of v1 and v2 engine. DO NOT TOUCH!
Declaration
public static object _lockNorgate
Field Value
Type | Description |
---|---|
object |
Methods
| Edit this page View SourceCustomGetAsset(Algorithm, string, Func<List<BarType<OHLCV>>>)
Declaration
public static TimeSeriesAsset CustomGetAsset(Algorithm owner, string nickname, Func<List<BarType<OHLCV>>> retrieve)
Parameters
Type | Name | Description |
---|---|---|
Algorithm | owner | |
string | nickname | |
Func<List<BarType<OHLCV>>> | retrieve |
Returns
Type | Description |
---|---|
TimeSeriesAsset |
LoadAsset(Algorithm, string)
Load asset data from various data feeds.
Declaration
public static TimeSeriesAsset LoadAsset(Algorithm owner, string nickname)
Parameters
Type | Name | Description |
---|---|---|
Algorithm | owner | parent/ owning algorithm |
string | nickname | asset nickname |
Returns
Type | Description |
---|---|
TimeSeriesAsset | time series for asset |
Exceptions
Type | Condition |
---|---|
Exception |
LoadAsset(Algorithm, IAlgorithm)
Load result from child algorithm as an asset.
Declaration
public static TimeSeriesAsset LoadAsset(Algorithm owner, IAlgorithm generator)
Parameters
Type | Name | Description |
---|---|---|
Algorithm | owner | parent/ owning algorithm |
IAlgorithm | generator | child/ generating algorithm |
Returns
Type | Description |
---|---|
TimeSeriesAsset |
StaticGetUniverse(Algorithm, string, string)
Return static universe. The constituents for these universes are time-invariant, hence suffering from survivorship bias.
Declaration
public static HashSet<string> StaticGetUniverse(Algorithm algo, string universe, string datafeed)
Parameters
Type | Name | Description |
---|---|---|
Algorithm | algo | parent algorithm |
string | universe | universe name |
string | datafeed | datafeed name |
Returns
Type | Description |
---|---|
HashSet<string> | universe constituents |
Exceptions
Type | Condition |
---|---|
Exception |
Universe(Algorithm, string)
Get constituents of universe.
Declaration
public static HashSet<string> Universe(Algorithm algo, string name)
Parameters
Type | Name | Description |
---|---|---|
Algorithm | algo | parent algorithm |
string | name | universe name |
Returns
Type | Description |
---|---|
HashSet<string> | universe constituents |