Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

unhandled error: there already is a market data handler subscribed

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

    unhandled error: there already is a market data handler subscribed

    I'm using CQG data with demo account
    I have multiple test accounts that use same data source on one instance of Ninja, and I use the DLL interface to communicate to NinjaTrader 8

    my DLL handler constantly uses SubscribeMarketData, gets the price then does UnsubscribeMarketData. The time interval is 1 second but I have multiple instances that might overlap. I'm checking MES and MNQ

    I get the "unhandled error: there already is a market data handler subscribed" very often. Any ideas what causes this?
    here is a screenshot
    Click image for larger version  Name:	image.png Views:	0 Size:	260.3 KB ID:	1220438
    Attached Files

    #2
    Hello Ray11,

    Is unsubscribe and subscribe happening rapidly?

    Why are you unsubscribing from the market data if you intend to subscribe again? Would it not be possible to leave the subscription enabled?

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_ChelseaB and thanks for replying ​
      ​yes, the subscription/unsubscription is rapid during data acquisition. I thought unsubscribing is needed to make the Ninjatrader perform correctly. Would it be Ok if I dont subscribe for a long time/ever?

      Comment


        #4
        Hello Ray11,

        Stay subscribed for as long as you need data.

        Unsubscribe when you no longer need data for that instrument (or won't need data for a really long time).

        Also, unsubscribe before tearing down.

        Below is a link to a forum post with some info on the API.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          thanks, understood.
          What I also get from this conversation is that if I unsubscribe from a specific instrument in one instance, the rest of instances will be affected. That probably is the source of the error.

          Comment


            #6
            Hello Ray11,

            What are you meaning by instances? Do you have your custom application running multiple instances all connecting to the same NinjaTrader API interface?

            Or are you referring to each instrument subscription as an instance?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              The earlier, multiple instances all connecting to the same NinjaTrader API and requesting same instrument data

              Comment


                #8
                Hello Ray11,

                Unfortunately, I've not had the opportunity to be asked this question and I'm not certain if connecting multiple applications to the API simultaneously is supported.

                I'll ask our developers and I'll let you know what they say.

                That said, even if it is supported, that would definitely cause an issue if multiple applications are subscribing and unsubscribing the same instrument rapidly.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by rhyminkevin, Today, 04:58 PM
                3 responses
                50 views
                0 likes
                Last Post Anfedport  
                Started by iceman2018, Today, 05:07 PM
                0 responses
                5 views
                0 likes
                Last Post iceman2018  
                Started by lightsun47, Today, 03:51 PM
                0 responses
                7 views
                0 likes
                Last Post lightsun47  
                Started by 00nevest, Today, 02:27 PM
                1 response
                14 views
                0 likes
                Last Post 00nevest  
                Started by futtrader, 04-21-2024, 01:50 AM
                4 responses
                50 views
                0 likes
                Last Post futtrader  
                Working...
                X