Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Data Subscriptions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Market Data Subscriptions

    A few years back I noticed a bug with Ninjatrader 8 that caused instruments that popped up on the hotlist analyzer to consume a market data subscription, and not release it if it fell off the list. I'm currently working on an addon and I'm running into a similar issue. Due to this I have two questions.
    Is there a way for me to see how many/what market data subscriptions are currently active?
    Is there a way for me to clear the currently active subscriptions?
    This does seem to be at least somewhat supported in according to the documentation here but it doesn't seem to want to work the way I'm thinking.
    It also doesn't seem to like this at all.
    Code:
    foreach (Instrument inst in NinjaTrader.Cbi.InstrumentList.All)
    {
        if (inst != null)
            inst.MarketData.Update -= OnMarketData;
    }​
    ​

    #2
    Hello RaddiFX,

    Thank you for your post.

    In an add on script, you are only subscribed to market data subscription if you have started the subscription in the first place.

    I suspect you are running into issues because you are trying to unsubscribe from market data updates your script hasn't actually started a subscription for. From the Help Guide:

    "Notes:

    1.Remember to unsubscribe if you are no longer using the subscription.

    2.You should only unsubscribe to a market data event if you are actually subscribed."



    Please let us know if you have any further questions.

    Comment


      #3
      So would there be a way for me to make a button to unsubscribe from all known subscriptions? Right now I need to restart Ninjatrader to clear out the subscriptions.

      Comment


        #4
        Hello RaddiFX,

        You could make a button that would trigger the unsubscribe, however I would like to reiterate that your script is only subscribed to any market data updates that you have explicitly coded it to be subscribed to.

        The help guide page linked in my last post has an example of subscribing and unsubscribing to market data events in an Add On script.

        Please let me know if this doesn't guide you in the right direction.

        Comment


          #5
          I understand how to do that with the subscriptions of the script itself, but it's not my addon that's consuming the excess subscriptions, it's the hotlist. So what I need to figure out is if there is a way to unsubscribe from all subscriptions that the entire ninjatrader platform is subscribed to without just restarting the software.

          Comment


            #6
            Hello RaddiFX,

            I'm not aware of a supported/documented to unsubscribe to market data updates from a Hot List from a separate Add On script.

            You can remove any instruments you don't want the platform to get updates from in the Hot List, similar to the Market Analyzer.

            Please let me know if you have any further questions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            61 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            39 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            21 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            23 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            51 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X