• Ask a question
  • Spaces
    • TT® Platform
    • Autospreader®
    • Autotrader™
    • Charting & Analytics
    • Options
    • ADL®
      • ADL Samples
    • RTD
    • APIs
      • TT .NET SDK
      • TT API & XT API
      • TT REST API
    • Cryptocurrencies
    • Topics
    • Questions
    • Articles
    • Ideas
    • Badges
  • Sign in
  • Home /
  • APIs /
  • TT .NET SDK /
avatar image
0
Question by kevinwilson21 · May 07, 2020 at 02:43 PM · TT.NET.SDK

Trade Subscription Product Filter

Can you filter Trade Subscription by product? Thanks!

Comment
Add comment
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by trishmessina · May 07, 2020 at 03:35 PM

@kevinwilson21 Yes with the caveat that you have to write the filter. Derive your custom filter from TradeSubscriptionFilter, implement the abstract methods and use that filter by calling TradeSubscription.SetFilter(). For a product filter, in the IsMatch methods, just check if the incoming order/fill instrument is the product you want to see.

Comment
Add comment Show 2 · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kevinwilson21 · May 07, 2020 at 06:19 PM 0
Share

Okay great, once you said that it jarred my memory and I found some old code on api that works great. Thank you.

  1. classProdFilter:TradeSubscriptionFilter
  2. {
  3. privateProductKey m_Product;
  4. publicProdFilter(ProductKey product)
  5. :base(false,"Product")
  6. {
  7. m_Product = product;
  8. }
  9. publicoverrideTradeSubscriptionFilterClone()
  10. {
  11. returnnewProdFilter(m_Product);
  12. }
  13. publicoverrideboolIsEqual(TradeSubscriptionFilter filter)
  14. {
  15. return filter.Equals(this);
  16. }
  17. publicoverrideboolIsMatch(Fill fill)
  18. {
  19. return m_Product.Equals(fill.InstrumentKey.ProductKey);
  20. }
  21. publicoverrideboolIsMatch(Order order)
  22. {
  23. return m_Product.Equals(order.InstrumentKey.ProductKey);
  24. }
  25. }

avatar image trishmessina kevinwilson21 · May 07, 2020 at 06:20 PM 0
Share

@kevinwilson21 Excellent!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Community

Ask questions and share ideas about the TT® and X_TRADER® platforms.

First time here? See our Getting Started Guide and FAQs.

Follow

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

TT.NET SDK 4 Answers

Price of a product in real time with TT.NET SDK example 4 Answers

Can I subscribe to the same instrument via two applications with two different app keys? 1 Answer

trouble with TradeSubscriptionAndFilter 0 Answers

Conditional Based Order Firing 1 Answer

Trading Technologies Home - Legal - Privacy - Contact

© 2017 Trading Technologies International, Inc. All rights reserved.

Powered by AnswerHub

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • TT® Platform
  • Autospreader®
  • Autotrader™
  • Charting & Analytics
  • Options
  • ADL®
    • ADL Samples
  • RTD
  • APIs
    • TT .NET SDK
    • TT API & XT API
    • TT REST API
  • Cryptocurrencies
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges