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
PriceAdjustment
Gets/sets the method for adjusting historical prices. Defaults to Splits only.
public PriceAdjustment PriceAdjustment { get; set; }
Property Value
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
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
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
Returns
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
stringpriceAdjustment
PriceAdjustmentstartDate
DateTimeendDate
DateTimesymbol
string
Returns
Exceptions
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
stringpriceAdjustment
PriceAdjustmentsymbol
string
Returns
Exceptions
RetrieveAsync(string)
Retrieves raw data in csv format.
public Task<string> RetrieveAsync(string symbol)
Parameters
symbol
string
Returns
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
stringstartDate
DateTimeendDate
DateTimeformat
PersistenceFormatValid options are Csv and Json.
Returns
Exceptions
RetrieveMetaDataAsync(string)
Retreives metadata for the specified symbol.
public Task<Tiingo.MetaData> RetrieveMetaDataAsync(string symbol)
Parameters
symbol
string