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 timing with OnBarUpdate

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

    OnMarketData timing with OnBarUpdate

    I would think OnMarketData is executed before OnBarUpdate for a tick?

    The question is about FirstTickOfBar. Since I can't get FirstTickOfBar inside of OnMarketData. If I am accumulating volume in OnMarketData where is the cutoff for including everything in the same bar and not losing the first tick.

    If I zero out my accumulators in OnBarUpdate on FirstTickOfBar would I lose the first tick volume if I did this?

    I can get the right numbers I just need to know what the timing relationship is.

    Cheers.

    #2
    ct, I believe you could reset this in OnBarUpdate() and then reference one bar back to start your accumulation with this last tick's data as inital new bar value?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand

      not clear on "then reference one bar back to start your accumulation with this last tick's data as initial new bar value". By one bar do you mean one tick of the onmarketupdate routine? If so I understand.

      Any clue why the volume looks high in comparison to the vol indicator? I can send you my code.

      Comment


        #4
        ct,

        What Bertrand probably meant was that you can do this from OnBarUpdate() and just use FirstTickOfBar. When you check FirstTickOfBar and then back reference one bar with [1] instead of [0] you get all the information of the bar that just closed since the event to start a new bar is exactly the same event as the one that closes the previous bar.

        Not sure where exactly you are comparing volumes with each other. Remember the VOL indicator would need to be run with CalculateOnBarClose = false for you to see the VOL of the latest bar.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh

          Thanks for the clarification.

          I am comparing completed bars. See attached. Not the lines on the bars in panel 2. That is updownvolume indicator. The lines are about 20% of the onmarketdata bars.
          Attached Files
          Last edited by ct; 04-19-2010, 11:28 AM.

          Comment


            #6
            ct,

            Looks to me you are looking at two different instruments with the different indicators.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Josh

              You scared me for a sec. I did have the same indicator twice but panel 2 is only the fdax instrument.

              Panel 3 is the fesx.
              Last edited by ct; 04-19-2010, 12:21 PM.

              Comment


                #8
                Sorry, not sure what you mean. Aren't you comparing panel 2 to panel 3? FDAX and FESX would be different instruments so this would not be a valid comparison.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Josh

                  Can I send this indicator so you can take a look to see why my volume looks high? Not looking for a debug but would like to get that issue resolved.

                  Comment


                    #10
                    ct,

                    Please attach it here with instructions on how to set it up and what to look for. Thank you.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Josh

                      Can I email it?

                      Comment


                        #12
                        Sure thing. Please send it to support [at] ninjatrader [dot] com with Attn: Josh in the subject line and a link to this thread. Thank you.
                        Josh P.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by knowmad, Today, 03:52 AM
                        0 responses
                        14 views
                        0 likes
                        Last Post knowmad
                        by knowmad
                         
                        Started by tradingnasdaqprueba, Today, 03:42 AM
                        0 responses
                        11 views
                        0 likes
                        Last Post tradingnasdaqprueba  
                        Started by Haiasi, 04-25-2024, 06:53 PM
                        4 responses
                        63 views
                        0 likes
                        Last Post effraenk  
                        Started by ccbiasi, 11-23-2017, 06:06 AM
                        5 responses
                        2,207 views
                        0 likes
                        Last Post leodavis  
                        Started by kujista, Yesterday, 12:39 AM
                        2 responses
                        14 views
                        0 likes
                        Last Post kujista
                        by kujista
                         
                        Working...
                        X