Table of Contents

Class Tiingo

Namespace
Balsam.DataServers
Assembly
Balsam.Backtester.dll

Retrieves historical prices from tiingo.com.

public class Tiingo : BarServer, IBarServer
Inheritance
Tiingo
Implements
Inherited Members
Extension Methods

Constructors

Tiingo()

Instantiates a new Tiingo bar server.

public Tiingo()

Tiingo(string)

Instantiates a new Tiingo bar server using the specified API key.

public Tiingo(string apiKey)

Parameters

apiKey string

Properties

ApiKey

Gets/sets the API key used as credentials.

public string ApiKey { get; set; }

Property Value

string

PriceAdjustment

Gets/sets the method for adjusting historical prices. Defaults to Splits only.

public PriceAdjustment PriceAdjustment { get; set; }

Property Value

PriceAdjustment

RequestMetaData

Gets/sets whether to request metadata to populate the instrument data. This results in a second call to the web API.

public bool RequestMetaData { get; set; }

Property Value

bool

Methods

OnGetSymbols()

Not supported for Tiingo. See https://apimedia.tiingo.com/docs/tiingo/daily/supported_tickers.zip for a list of supported tickers.

protected override IEnumerable<string> OnGetSymbols()

Returns

IEnumerable<string>

OnLoadSymbol(string, DateTime, DateTime, int)

Requests and process the specified symbol. The raw Tiingo response will be include in the Tag property.

protected override BarSeries OnLoadSymbol(string symbol, DateTime startDate, DateTime endDate, int barsToLoad = 2147483647)

Parameters

symbol string
startDate DateTime
endDate DateTime
barsToLoad int

Returns

BarSeries

ParseResponse(string, PriceAdjustment, DateTime, DateTime, string)

Converts a raw Tinngo response into a BarSeries using the specified paramters. Currently this only works with csv data.

public static BarSeries ParseResponse(string response, PriceAdjustment priceAdjustment, DateTime startDate, DateTime endDate, string symbol = null)

Parameters

response string
priceAdjustment PriceAdjustment
startDate DateTime
endDate DateTime
symbol string

Returns

BarSeries

Exceptions

NotSupportedException

ParseResponse(string, PriceAdjustment, string)

Converts a raw Tiingo response into a BarSeries using the specified price adjustment methodology. Currently this only works with csv data.

public static BarSeries ParseResponse(string response, PriceAdjustment priceAdjustment, string symbol = null)

Parameters

response string
priceAdjustment PriceAdjustment
symbol string

Returns

BarSeries

Exceptions

NotSupportedException

RetrieveAsync(string)

Retrieves raw data in csv format.

public Task<string> RetrieveAsync(string symbol)

Parameters

symbol string

Returns

Task<string>

RetrieveAsync(string, DateTime, DateTime, PersistenceFormat)

Retreives raw data using the specified parameters.

public Task<string> RetrieveAsync(string symbol, DateTime startDate, DateTime endDate, PersistenceFormat format)

Parameters

symbol string
startDate DateTime
endDate DateTime
format PersistenceFormat

Valid options are Csv and Json.

Returns

Task<string>

Exceptions

InvalidOperationException
ArgumentOutOfRangeException

RetrieveMetaDataAsync(string)

Retreives metadata for the specified symbol.

public Task<Tiingo.MetaData> RetrieveMetaDataAsync(string symbol)

Parameters

symbol string

Returns

Task<Tiingo.MetaData>

Exceptions

ArgumentException