Table of Contents

Class BinaryBarServer<T>

Namespace
Balsam.DataServers
Assembly
Balsam.Backtester.dll

Creates a bar server that can load bars stored in binary format and return a custom bar type.

public class BinaryBarServer<T> : BarServer, IBarServer where T : Bar

Type Parameters

T
Inheritance
BinaryBarServer<T>
Implements
Derived
Inherited Members
Extension Methods

Constructors

BinaryBarServer(string)

Instantiates a new BinaryBarServer using the specified directory.

public BinaryBarServer(string directory)

Parameters

directory string

Properties

Directory

Gets the directory.

public string Directory { get; }

Property Value

string

Extension

Gets/sets the file extension.

public string Extension { get; set; }

Property Value

string

Instruments

Gets/sets the InstrumentDictionary being used to provide Instrument data.

public InstrumentCollection Instruments { get; set; }

Property Value

InstrumentCollection

Methods

Connect()

Connects the server.

public void Connect()

GetInstrument(string)

Returns the instrument for the specified symbol or the default instrument if not found.

protected virtual Instrument GetInstrument(string symbol)

Parameters

symbol string

Returns

Instrument

OnGetSymbols()

Returns the symbols matching the file extension.

protected override IEnumerable<string> OnGetSymbols()

Returns

IEnumerable<string>

OnLoadSymbol(string, DateTime, DateTime, int)

Loads the file from disk

protected override 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[])

Overrides base implementation to load on multiple threads.

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

Parameters

startDate DateTime
endDate DateTime
symbols string[]

Returns

BarSeriesCollection