Query Example using OnixS.CmeStpHandler;
void Main()
{
Session session = new Session(new Uri("UrlValue"), "SenderCompIdValue", "SenderSubIdValue", "Password");
session.TradeCaptureReportReceived += new EventHandler<TradeCaptureReportEventArgs>(session_TradeCaptureReportReceived);
session.TradeCaptureReportRequestAcknowledgementReceived += new EventHandler<TradeCaptureReportRequestAcknowledgementEventArgs>(session_TradeCaptureReportRequestAcknowledgementReceived);
TradeCaptureReportRequest request = new TradeCaptureReportRequest();
request.Instruments.Add(new RequestInstrument() { SecurityExchange = SecurityExchange.Nymex });
request.TradeCaptureDate.TradeDate = new DateTime(2010, 05, 10);
subscriptionId = session.Query(request);
}
void session_TradeCaptureReportReceived(object sender, TradeCaptureReportEventArgs e)
{
Console.WriteLine("Trade Capture Report Received.");
}
void session_TradeCaptureReportRequestAcknowledgementReceived(object sender, TradeCaptureReportRequestAcknowledgementEventArgs e)
{
switch (e.TradeCaptureReportRequestAcknowledgement.TradeRequestStatus)
{
case TradeRequestStatus.Accepted:
Console.WriteLine("Trade Capture Report Request accepted: " + report.TradeRequestResult.ToString());
break;
case TradeRequestStatus.Completed:
Console.WriteLine("Trade Capture Report Request completed: " + report.TradeRequestResult.ToString());
break;
case TradeRequestStatus.Rejected:
Console.WriteLine("Trade Capture Report Request rejected: " + report.TradeRequestResult.ToString() + ", " + report.Text);
break;
}
}