Table of Contents

Class FREDServer

Namespace
Balsam.DataServers
Assembly
Balsam.Backtester.dll

Returns timeseries objects from the St. Loius Federal Reserve's FRED database.

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

Constructors

FREDServer()

Instantiates a new FREDServer object.

public FREDServer()

FREDServer(string)

Instantiates a new FREDServer using the specified API key.

public FREDServer(string apiKey)

Parameters

apiKey string

Properties

ApiKey

Gets/sets the API key used as credentials.

public string ApiKey { get; set; }

Property Value

string

Methods

GetPointInTimeHistory(string, DateTime, DateTime, int)

Retrieves point-in-time data using the specified parameters.

public ObservationSeries GetPointInTimeHistory(string symbol, DateTime startDate, DateTime endDate, int requestSize = 500)

Parameters

symbol string
startDate DateTime
endDate DateTime
requestSize int

Number of vintage dates to request at a time. Lower the request size if you get 504 gateway timeout errors.

Returns

ObservationSeries

Exceptions

InvalidOperationException
ArgumentNullException
ArgumentOutOfRangeException

GetPointInTimeHistory(string, int)

Retrieves point-in-time data for the specified symbol.

public ObservationSeries GetPointInTimeHistory(string symbol, int requestSize = 500)

Parameters

symbol string
requestSize int

Number of vintage dates to request at a time. Lower the request size if you get 504 gateway timeout errors.

Returns

ObservationSeries

GetVintageDates(string)

Gets the vintage dates for the specified symbol.

public IEnumerable<DateTime> GetVintageDates(string symbol)

Parameters

symbol string

Returns

IEnumerable<DateTime>

GetVintageDates(string, DateTime, DateTime)

Gets the vintage dates for the specified symbol between the specified realtime start and end dates.

public IEnumerable<DateTime> GetVintageDates(string symbol, DateTime startDate, DateTime endDate)

Parameters

symbol string
startDate DateTime
endDate DateTime

Returns

IEnumerable<DateTime>

Exceptions

InvalidOperationException
ArgumentNullException
ArgumentOutOfRangeException

GetVintageDatesAsync(string, DateTime, DateTime)

Gets vintage dates for the specified symbol.

public Task<IEnumerable<DateTime>> GetVintageDatesAsync(string symbol, DateTime startDate, DateTime endDate)

Parameters

symbol string
startDate DateTime
endDate DateTime

Returns

Task<IEnumerable<DateTime>>

Exceptions

InvalidOperationException
ArgumentNullException
ArgumentOutOfRangeException

LoadSymbolAsync(string, DateTime, DateTime, int)

Loads the specified symbol via the web API.

public Task<BarSeries> LoadSymbolAsync(string symbol, DateTime startDate, DateTime endDate, int barsToLoad = 2147483647)

Parameters

symbol string
startDate DateTime
endDate DateTime
barsToLoad int

Returns

Task<BarSeries>

Exceptions

InvalidOperationException
ArgumentNullException
ArgumentOutOfRangeException

LoadSymbolByVintageDate(string, DateTime)

Returns observations available for the specified symbol and vintage date.

public ObservationSeries LoadSymbolByVintageDate(string symbol, DateTime vintageDate)

Parameters

symbol string
vintageDate DateTime

Returns

ObservationSeries

LoadSymbolByVintageDateAsync(string, DateTime)

Returns observations available for the specified symbol on the specified vintage date.

public Task<ObservationSeries> LoadSymbolByVintageDateAsync(string symbol, DateTime vintageDate)

Parameters

symbol string
vintageDate DateTime

Returns

Task<ObservationSeries>

Exceptions

InvalidOperationException
ArgumentNullException
ArgumentOutOfRangeException

OnGetSymbols()

Not supported.

protected override IEnumerable<string> OnGetSymbols()

Returns

IEnumerable<string>

OnLoadSymbol(string, DateTime, DateTime, int)

Loads data from the web API.

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

Parameters

symbol string
startDate DateTime
endDate DateTime
barsToLoad int

Limit to n records. Note holidays will not be included so you will potentially get less data back than specified.

Returns

BarSeries