Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

OnMarketData Volume & Tick Issues

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

    OnMarketData Volume & Tick Issues

    NT,

    I have noticed that I am getting bad tick and volume counts while collecting data in the OnMarketData section of code.

    It seems that when using if (FirstTickOfBar) to reset tick or volume counters for the prior bar, I loose the data for the first tick of the current bar.

    Is this normal???

    By time FirstTickOfBar executes, the first tick of the bar has already executed and the data for the first tick is gone!!!!

    Pictures of this problem along with additional text can be found here.

    What does NT say about this? Bug? Design-flaw? Working as intended, no problem, cannot reproduce, ... ? If you use a Volume bar, at set the volume bar to 'xxx' vol, does your indicator match what NT is showing as the volume on the bar? Mike Each tick fires OnMarketData and OnBarUpdate(if COBC = false) as well. OnMarketData is fired before OnBarUpdate. if you are using same variables in both event handlers - be careful - you might set it in one and reset in another. I would not use CurrentBar …


    Is this a known bug????

    Thanks,

    RJay
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    #2
    Hello,

    Just to clarify,

    Your using FirstTickOfBar in OnBarUpdate() correct and not OnMarketData().

    Can you I please see the code your using for If FirstTickOfBar, your not using return or anything like the right?

    These counter variables, are you updating them in OnMarketData() or OnBarUpdate()?

    I look forward to assisting you further.

    Comment


      #3
      I'm using first tick of bar in OnMarketData().
      RJay
      NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

      Comment


        #4
        Hello,

        Please see the following page:



        Please see the following Note on this page.

        NOTE: This property should NOT be accessed outside of the OnBarUpdate() method.

        Using this in OnMarketData() coudl yield unexpected results. Please resolve this before continuing on. Also please insure your not using a return; command to exit the loop before variables are updated as this would cause you to lose your FirstTickOfBar data.

        Let me know if I can be of further assistance.

        Comment


          #5
          Just wanted to clarify this.

          Thanks,

          RJay
          RJay
          NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by funk10101, Today, 12:02 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by GLFX005, Today, 03:23 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by nandhumca, Yesterday, 03:41 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by The_Sec, Yesterday, 03:37 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by vecnopus, Today, 06:15 AM
          0 responses
          1 view
          0 likes
          Last Post vecnopus  
          Working...
          X