Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Anomoly/Problem with OnMarketData event loop

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

    Anomoly/Problem with OnMarketData event loop

    After testing this and then realising i had a secondary series i added yesterday for other calculations and checking it was apparent that the OnMarketData event loop was being invoked for this secondary series in addition to the primary.

    Is there a way to disable this for the second series?

    Or is it a case of storing in a variable the value of BarsInProgress in OnBarUpdate that can be used in OnMarketData to filter out and do not calculate/store the secondary series events. I recall as with CurrentBar that BarsInProgress value is not guaranteed outside the scope of OnBarUpdate ? Is this correct?

    I would rather not receive onmarketdata events for the secondary series if this is possible but suspect there isnt a way to do this.

    thanks
    Last edited by soulfx; 05-31-2017, 06:32 AM.

    #2
    Hello soulfx,

    Thanks for your post.

    Correct, according to the helpguide, "4. With multi-time frame and instrument strategies, a subscription will be created all bars series added in your indicator or strategy (even if the instrument is the same). The market data subscription behavior occurs both in real-time and during TickReplay historical Reference: http://ninjatrader.com/support/helpG...marketdata.htm

    You can add a BarsInProgress check statement in OMD to return if not the BIP of interest.

    Comment


      #3
      Hello, thanks for the reply. As i suspected and just wanted to check to see if there was a way to disable the subscription. Would it be a small/material change to provide a method when adding the second series to disable any market data/market depth subscriptions in the Configure section of State management? If so perhaps could be added/included as a feature request.

      Also is it your recommendation that i store the current value of BarsInProgress in onBarUpdate in a different variable to use in OnMarketData() - or is it considered safe to use BarsInProgress in OnMarketData.

      Also feel free to change the original title if you want - as i couldn't edit it once i realised it was the secondary series that was generating the additional events

      thanks

      Comment


        #4
        Hello soulfx,

        Thanks for your reply.

        I will write up a feature request to provide a method or means to optionally disable OMD/D events for added dataseries and will update this thread when I have that feature request.

        In my tests I had no issues using BarsInProgress as is. You can test as well and use a variable if you prefer.

        Comment


          #5
          Hello soulfx,

          The feature request has been assigned SFT-2317, "Option to disable OnMarketData() and OnMarketDepth() for additional dataseries"

          Thanks for your suggestion and interest in improving NinjaTrader8.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X