Creating and Submitting Request for Quotes (RFQs)
Overview
The TT .NET SDK can be used to both subscribe to Requests for Quote (RFQs) using the RequestForQuoteSubscription class and to submit RFQ requests. When subscribing to RFQs, you must create the subscription object, set any options, register for events, and start the subscription.
Creating an RFQ Subscription
To create a RFQ subscription and start receiving updates, you:
- Instantiate a RequestForQuoteSubscription object for a specific product.
- Create an event handler method to be called on RFQ data updates for the Product.
- Register the event handler with the RequestForQuoteSubscription instance.
- Call the Start method of the RequestForQuoteSubscription instance.
Instantiation the RequestForQuoteSubscription Class
var rfq = new RequestForQuoteSubscription(product, callback_disp);
rfq.Update += new EventHandler<RequestForQuoteEventArgs>(OnRFQUpdate);
rfq.Start();
RFQ Update event Handler
public void OnRFQUpdate(object sender, RequestForQuoteEventArgs e)
{
Console.WriteLine("RFQ Product : " + e.Product);
foreach (var q in e.Data)
{
Console.WriteLine(" " + q);
}
}
Process for Submitting Request for Quote (RFQ)
Send Request for Quote
RFQ can be requested using SendRFQ function of TradeSubscription like below:
tradeSubscription.SendRFQ(instrument, apiInstance.DefaultAccount);
Subscribe QuoteResponse event handler of TradeSubscription to receive response for the requested RFQ using SendRFQ, as shown below:
tradeSubscription.QuoteResponse += new EventHandler<QuoteResponseEventArgs>(OnQuoteRequestResponse);
QuoteResponse Event Handler
public void OnQuoteRequestResponse(object sender, QuoteResponseEventArgs e)
{
Console.WriteLine("QuoteRequestResponse: " + e);
}