NeedForTrade Documentation

BarCollection Class

Represents collection of Bars.

 

BarCollection members:

 

    // Properties

    // Indexer to get Bar by index
    Bar this[int index]

    Instrument Instrument
    BarType BarType

    // Bars count in the collection
    int Count 

    // Interval multiplier e.g. 15 for 15-minutes bars, 100 for 100-tick bars,...     
    int IntervalMultiplier 
    
    // Returns true, if data in the collection is real-time
    bool RealTime
    // Returns true, if last bar in the collection is real-time
    bool LastBarIsRealTime

    // Retrieving DoubleSeries
    DoubleSeries GetDoubleSeries(BarPriceType barPriceType);
    DoubleSeries OpenSeries
    DoubleSeries HighSeries
    DoubleSeries LowSeries
    DoubleSeries CloseSeries
    DoubleSeries OpenInterestSeries
    DoubleSeries VolumeSeries

    // Collection support
    void Add(Bar value);
    void AddRange(BarCollection value);
    void AddRange(Bar[] value);


Bars are counted from 0 to Count.To access 10th bar within collection use the following syntax: bar = bars[10]; Often bars are stored in BarCollection in reverse order: bars[0] - most recent bar, bar[1] - previous bar,... BarCollection can be read-only.
If you will try to change elements of read-only collection NotSupportedException exception will be generated.