Show / Hide Table of Contents

Class DataSource

Base class for data sources, providing a bar enumerator for one or more instruments. Other than instantiating data sources through the factory method New(), and adding them to the Algorithm's DataSources property, application developers do not need to interact with data sources directly.

Inheritance
object
DataSource
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TuringTrader.Simulator
Assembly: TuringTrader.Simulator.dll
Syntax
public abstract class DataSource

Constructors

| Edit this page View Source

DataSource(Dictionary<DataSourceParam, string>)

Create and initialize data source object.

Declaration
protected DataSource(Dictionary<DataSourceParam, string> info)
Parameters
Type Name Description
Dictionary<DataSourceParam, string> info

data source info

Fields

| Edit this page View Source

CachedData

Data sources using the cache make their data accessible here. This may be used for algorithms and report generators, e.g., MFE/MAE analysis, which requires access to the data independent of the simulator's current bar.

Declaration
public List<Bar> CachedData
Field Value
Type Description
List<Bar>
| Edit this page View Source

Simulator

Reference to simulator this instance is associated with.

Declaration
public SimulatorCore Simulator
Field Value
Type Description
SimulatorCore

Properties

| Edit this page View Source

Algorithm

Algorithms only: return algorithm instance.

Declaration
public virtual Algorithm Algorithm { get; }
Property Value
Type Description
Algorithm
| Edit this page View Source

DataPath

Path to data base.

Declaration
public static string DataPath { get; }
Property Value
Type Description
string
| Edit this page View Source

Info

Data source info container.

Declaration
public Dictionary<DataSourceParam, string> Info { get; protected set; }
Property Value
Type Description
Dictionary<DataSourceParam, string>
| Edit this page View Source

Instrument

Instrument associated with data source. Will return only first one, in case there is a one-to-many relationship.

Declaration
public Instrument Instrument { get; }
Property Value
Type Description
Instrument
| Edit this page View Source

IsAlgorithm

True, if this data source is describes an algorithm

Declaration
public virtual bool IsAlgorithm { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsOption

True, if this data source describes option contracts.

Declaration
public bool IsOption { get; }
Property Value
Type Description
bool
| Edit this page View Source

OptionUnderlying

Options only: Underlying symbol.

Declaration
public string OptionUnderlying { get; }
Property Value
Type Description
string

Methods

| Edit this page View Source

LoadData(DateTime, DateTime)

Load data between time stamps into memory.

Declaration
public abstract IEnumerable<Bar> LoadData(DateTime startTime, DateTime endTime)
Parameters
Type Name Description
DateTime startTime

beginning time stamp

DateTime endTime

end time stamp

Returns
Type Description
IEnumerable<Bar>
| Edit this page View Source

New(string)

Factory function to instantiate new data source.

Declaration
public static DataSource New(string nickname)
Parameters
Type Name Description
string nickname

nickname

Returns
Type Description
DataSource

data source object

| Edit this page View Source

New(Algorithm)

Factory function to instantiate new algorithm data source.

Declaration
public static DataSource New(Algorithm algo)
Parameters
Type Name Description
Algorithm algo

nickname

Returns
Type Description
DataSource

data source object

  • Edit this page
  • View Source
In this article
Back to top Copyright © 2011-2023, Bertram Enterprises LLC dba TuringTrader.com