Class BarSeriesCollection
- Namespace
- Balsam
- Assembly
- Balsam.Backtester.dll
A collection of BarSeries accessible by symbol or index.
public class BarSeriesCollection : SeriesCollectionBase<BarSeries>, IEnumerable<BarSeries>, IEnumerable, ISeries, INotifyCollectionChanged, ICloneable
- Inheritance
-
BarSeriesCollection
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
BarSeriesCollection()
Initializes an empty BarSeriesCollection.
public BarSeriesCollection()
BarSeriesCollection(IEnumerable<BarSeries>)
Initializes a new BarSeriesCollection and adds the specified series.
public BarSeriesCollection(IEnumerable<BarSeries> series)
Parameters
series
IEnumerable<BarSeries>
BarSeriesCollection(int)
Initializes a new BarSeriesCollection with the specified capacity.
public BarSeriesCollection(int capacity)
Parameters
capacity
int
Properties
Source
Gets/sets information about the data source. Some bar servers may choose to provide this for informational or audit trail purposes.
public DataSource Source { get; set; }
Property Value
Methods
Compress(ICompressionProvider)
Returns a new BarSeriesCollection with every series compressed using the specified compression provider.
public BarSeriesCollection Compress(ICompressionProvider provider)
Parameters
provider
ICompressionProvider
Returns
Load(string)
Loads a BarSeriesCollection that has been persisted to disk in binary format.
public static BarSeriesCollection Load(string fileName)
Parameters
fileName
string
Returns
OnSave(string)
Overrides the base implementation to persist using custom binary format.
protected override void OnSave(string fileName)
Parameters
fileName
string
OnSync(IEnumerable<DateTime>, SyncOption)
Syncs the collection using the specified dates and sync option.
protected override ISeries OnSync(IEnumerable<DateTime> dates, SyncOption syncOption)
Parameters
dates
IEnumerable<DateTime>syncOption
SyncOption
Returns
Subset(DateTime)
Returns a new BarSeriesCollection where every series starts at the specified start date.
public BarSeriesCollection Subset(DateTime startDate)
Parameters
startDate
DateTime
Returns
Subset(DateTime, DateTime)
Returns a new BarSeriesCollection where every series starts and ends at the specified dates.
public BarSeriesCollection Subset(DateTime startDate, DateTime endDate)
Parameters
Returns
Sync(ISeries)
Returns a new BarSeriesCollection with all items synced to the specified ISeries carrying over the previous value if missing.
public BarSeriesCollection Sync(ISeries series)
Parameters
series
ISeries
Returns
Sync(ISeries, SyncOption)
Returns a new BarSeriesCollection with all items synced to the specified ISeries using the specified sync option.
public BarSeriesCollection Sync(ISeries series, SyncOption syncOption)
Parameters
series
ISeriessyncOption
SyncOption
Returns
Sync(IEnumerable<DateTime>)
Returns a new BarSeriesCollection with all items synced to the specified dates carrying over the previous value if missing.
public BarSeriesCollection Sync(IEnumerable<DateTime> dates)
Parameters
dates
IEnumerable<DateTime>
Returns
Sync(IEnumerable<DateTime>, SyncOption)
Returns a new BarSeriesCollection with all items synced to the specified dates using the specified sync option.
public BarSeriesCollection Sync(IEnumerable<DateTime> dates, SyncOption syncOption)
Parameters
dates
IEnumerable<DateTime>syncOption
SyncOption