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
LoadAll()
Returns a BarSeriesCollection containing all available data.
public BarSeriesCollection LoadAll()
Returns
LoadAll(DateTime)
Returns a BarSeriesCollection for all available symbols beginning at the specified start date.
public BarSeriesCollection LoadAll(DateTime startDate)
Parameters
startDate
DateTime
Returns
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
Returns
LoadSymbol(string)
Loads the specified symbol and returns all available data.
public BarSeries LoadSymbol(string symbol)
Parameters
symbol
string
Returns
LoadSymbol(string, DateTime)
Loads the specified symbol and returns all data from the startdate or later.
public BarSeries LoadSymbol(string symbol, DateTime startDate)
Parameters
Returns
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
Returns
LoadSymbol(string, int)
Loads the specified symbol and returns the most recent number of bars specified.
public BarSeries LoadSymbol(string symbol, int barsToLoad)
Parameters
Returns
LoadSymbols(IEnumerable<string>)
Returns a BarSeriesCollection for the specified symbols.
public BarSeriesCollection LoadSymbols(IEnumerable<string> symbols)
Parameters
symbols
IEnumerable<string>
Returns
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
Returns
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
Returns
LoadSymbols(params string[])
Returns a BarSeriesCollection for the specified symbols.
public BarSeriesCollection LoadSymbols(params string[] symbols)
Parameters
symbols
string[]
Returns
OnGetSymbols()
Implement this method to return available symbols.
protected abstract IEnumerable<string> OnGetSymbols()
Returns
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
Returns
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
Returns
OnMessage(MessageEventArgs)
Raises a message.
protected virtual void OnMessage(MessageEventArgs e)
Parameters
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
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
Returns
Events
Message
Raises an event with a message reporting server status or errors.
public event EventHandler<MessageEventArgs> Message