Table of Contents

Class BarServer

Namespace
Balsam.DataServers
Assembly
Balsam.Backtester.dll

An abstract base class that implements core functionality for a BarServer.

public abstract class BarServer : IBarServer
Inheritance
BarServer
Implements
Derived
Inherited Members
Extension Methods

Methods

GetSymbols()

Gets the symbols available from this bar server.

public IEnumerable<string> GetSymbols()

Returns

IEnumerable<string>

LoadAll()

Returns a BarSeriesCollection containing all available data.

public BarSeriesCollection LoadAll()

Returns

BarSeriesCollection

LoadAll(DateTime)

Returns a BarSeriesCollection for all available symbols beginning at the specified start date.

public BarSeriesCollection LoadAll(DateTime startDate)

Parameters

startDate DateTime

Returns

BarSeriesCollection

LoadAll(DateTime, DateTime)

Returns a BarSeriesCollection for all available symbols containing data between the specified start and end dates.

public BarSeriesCollection LoadAll(DateTime startDate, DateTime endDate)

Parameters

startDate DateTime
endDate DateTime

Returns

BarSeriesCollection

LoadSymbol(string)

Loads the specified symbol and returns all available data.

public BarSeries LoadSymbol(string symbol)

Parameters

symbol string

Returns

BarSeries

LoadSymbol(string, DateTime)

Loads the specified symbol and returns all data from the startdate or later.

public BarSeries LoadSymbol(string symbol, DateTime startDate)

Parameters

symbol string
startDate DateTime

Returns

BarSeries

LoadSymbol(string, DateTime, DateTime)

Loads the specified symbol and returns data between the specified start and end dates.

public BarSeries LoadSymbol(string symbol, DateTime startDate, DateTime endDate)

Parameters

symbol string
startDate DateTime
endDate DateTime

Returns

BarSeries

LoadSymbol(string, int)

Loads the specified symbol and returns the most recent number of bars specified.

public BarSeries LoadSymbol(string symbol, int barsToLoad)

Parameters

symbol string
barsToLoad int

Returns

BarSeries

LoadSymbols(IEnumerable<string>)

Returns a BarSeriesCollection for the specified symbols.

public BarSeriesCollection LoadSymbols(IEnumerable<string> symbols)

Parameters

symbols IEnumerable<string>

Returns

BarSeriesCollection

LoadSymbols(DateTime, DateTime, params string[])

Returns a BarSeriesCollection for the specified symbols containing data between the specified start and end dates.

public BarSeriesCollection LoadSymbols(DateTime startDate, DateTime endDate, params string[] symbols)

Parameters

startDate DateTime
endDate DateTime
symbols string[]

Returns

BarSeriesCollection

LoadSymbols(DateTime, params string[])

Returns a BarSeriesCollection starting at the specified start date for the specified symbols.

public BarSeriesCollection LoadSymbols(DateTime startDate, params string[] symbols)

Parameters

startDate DateTime
symbols string[]

Returns

BarSeriesCollection

LoadSymbols(params string[])

Returns a BarSeriesCollection for the specified symbols.

public BarSeriesCollection LoadSymbols(params string[] symbols)

Parameters

symbols string[]

Returns

BarSeriesCollection

OnGetSymbols()

Implement this method to return available symbols.

protected abstract IEnumerable<string> OnGetSymbols()

Returns

IEnumerable<string>

OnLoadSymbol(string, DateTime, DateTime, int)

Implement this method to load the data.

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

Parameters

symbol string
startDate DateTime
endDate DateTime
barsToLoad int

Returns

BarSeries

OnLoadSymbols(DateTime, DateTime, params string[])

Loops through each symbol calling LoadSymbol. Override to change this behavior.

protected virtual BarSeriesCollection OnLoadSymbols(DateTime startDate, DateTime endDate, params string[] symbols)

Parameters

startDate DateTime
endDate DateTime
symbols string[]

Returns

BarSeriesCollection

OnMessage(MessageEventArgs)

Raises a message.

protected virtual void OnMessage(MessageEventArgs e)

Parameters

e MessageEventArgs

ParseSymbolFile(string)

Returns an enumerable of symbols by parsing the specified filename using a comma, pipe or tab delimiter to select the first column.

public IEnumerable<string> ParseSymbolFile(string fileName)

Parameters

fileName string

Returns

IEnumerable<string>

ParseSymbolFile(string, int, params string[])

Returns an enumerable of symbols by parsing the specified filename using the specified parameters.

public static IEnumerable<string> ParseSymbolFile(string fileName, int column, params string[] delimiters)

Parameters

fileName string
column int
delimiters string[]

Returns

IEnumerable<string>

Events

Message

Raises an event with a message reporting server status or errors.

public event EventHandler<MessageEventArgs> Message

Event Type

EventHandler<MessageEventArgs>