Using pre-defined trade subscription filters
By default, a trade subscription includes all orders and fills associated with a trader’s login credentials. You can use the following trade filters to create different subsets, or views, of an order book.
- tt_net_sdk.TradeSubscriptionTTAccountFilter, which includes only those orders and fills with a specified Account property value
- tt_net_sdk.TradeSubscriptionClearingAccountFilter, which includes only those orders and fills with a specified clearing account
- tt_net_sdk.TradeSubscriptionInstrumentFilter, which includes only those orders and fills for a specific Instrument
- tt_net_sdk.TradeSubscriptionSiteOrderKeyFilter, which includes only the order with the specified TT order key and its corresponding fills
The following example creates a trade subscription that includes only those orders and fills whose Account property contains "123".
TradeSubscription m_ts = new TradeSubscription(tt_net_sdk.Dispatcher.Current);
TradeSubscriptionTTAccountFilter tsAF =
new TradeSubscriptionTTAccountFilter("123", false, "Acct=123 Filter");
m_ts.SetFilter(tsAF);
m_ts.Start();
The second parameter in the constructor allows you to negate the filter. If it were set to true in the above example, only those order and fills whose Account property does NOT contain “123” would be included.
If you want to subscribe for a single Instrument, you could create an InstrumentTradeSubscription object. The InstrumentTradeSubscription class is derived from the TradeSubscription class and provides a view of all orders and fills for a single Instrument. Creating an InstrumentTradeSubscription is the same as instantiating a TradeSubscription object and adding a single TradeSubscriptionInstrumentFilter filter.