Class CsiBarServer
- Namespace
- Balsam.DataServers
- Assembly
- Balsam.Backtester.dll
A data server used to read ASCII futures history files exported by CSI's Unfair Advantage.
public class CsiBarServer : AsciiBarServer<ContinuousBar>, IBarServer
- Inheritance
-
CsiBarServer
- Implements
- Inherited Members
- Extension Methods
Constructors
CsiBarServer(string)
Initializes a new CsiBarServer using the specified directory and the default DOHLCVINU format.
public CsiBarServer(string directory)
Parameters
directory
string
CsiBarServer(string, params DataField[])
Instantiates a new CsiBarServer using the specified directory and format.
public CsiBarServer(string directory, params DataField[] fields)
Parameters
Properties
UseGenericInstrument
Gets/sets whether instruments are referenced by generic symbol (e.g. GC) or CSI symbol (e.g. GC2). Defaults to true.
public bool UseGenericInstrument { get; set; }
Property Value
UseShortSymbol
Gets/sets whether the short generic symbol or the full symbol contained in the filename is used.
public bool UseShortSymbol { get; set; }
Property Value
Methods
GetGenericSymbol(string)
Converts a CSI symbol into a standard generic instrument symbol (e.g. GC2 -> GC).
public static string GetGenericSymbol(string symbol)
Parameters
symbol
string
Returns
GetShortSymbol(string)
Converts a CSI symbol with embedded formatting information into a standard short symbol (e.g.GC20_I0B to GC2).
public static string GetShortSymbol(string symbol)
Parameters
symbol
string
Returns
OnGetInstrument(string)
Returns the instrument.
protected override Instrument OnGetInstrument(string symbol)
Parameters
symbol
string
Returns
OnGetSymbols()
Returns all available symbols.
protected override IEnumerable<string> OnGetSymbols()
Returns
OnLoadSymbol(string, DateTime, DateTime, int)
Returns the loaded BarSeries after applying post-processing by raising negative prices or applying conversion factor based on instrument symbol.
protected override BarSeries OnLoadSymbol(string symbol, DateTime startDate, DateTime endDate, int barsToLoad = 2147483647)
Parameters
Returns
OnProcessFile(string, string, DateTime, DateTime, int)
Reads the file and returns a list of CsiBars.
protected override List<Bar> OnProcessFile(string symbol, string fileName, DateTime startDate, DateTime endDate, int barsToLoad)
Parameters
Returns
OnResolveFileName(string)
Returns the filename to load.
protected override string OnResolveFileName(string symbol)
Parameters
symbol
string