?> QuantXpress – Deliver high performance automated trading and connectivity solutions



Bar Data Series


One of the basic tools of the analysis is Bar Chart and study of a chart pattern in technical analysis of stocks. BlitzTrader API provides all flexibility to harness the technical analysis based trading model with best execution controlled to manage your risk and reward with every event of the market.
GetMinuteBarDataSeries API retrieve the MinuteBar time series data of any minute compression. The historical data is maintained in Blitz Market Data Server (MDS). The IVMinuteBarDataSeries is linked to real-time market data event and Bar completion event is notified to registered callback method.
 
string errorString = string.Empty;
int BarSize = 1;
// Gets 1 minute bar data from historical Bid time series of last 25 days
// in sync with realtime data
IVMinuteBarDataSeries _ivMinuteBarSeries = GetMinuteBarDataSeries(_iv, 
                                                                  PriceType.Bid,
                                                                  BarSize,
                                                                  DateTime.Today.AddDays(-25),
                                                                  out errorString);

MinuteBarDataSeries minuteBarDataSeries = _ivMinuteBarSeries.BarDataSeries;
// Gets the latest bar data
IBarData barData = minuteBarDataSeries[minuteBarDataSeries.Count - 1];

// Bind to a callback method to receive a notification on every bar completion.
_ivMinuteBarSeries.OnBarCompleted += OnBarCompleted;

.......................
.......................
.......................

private void OnBarCompleted(string seriesID, IBarData barData)
{

}
Definition of IBarData interface

public interface IBarData
{
    long DateTime { get; }
    DateTime DateTimeDT { get; }
    double Open { get; }
    double High { get; }
    double Low { get; }
    double Close { get; }
    long Volume { get; }
    long OpenInterest { get; }
    bool IsCompleted { get; }
    double BarHLAverage { get; }
}