Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NTb7 FirstTickOfBar

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

    NTb7 FirstTickOfBar

    After loading beta7 some of my indicators seemed to quit working. Doing some research I find that FirstTickOfBar is not working as before. I use FirstTickOfBar to reset some variables which initialize the values in OnMarketData().

    OnBarUpdate()
    {
    if ( FirstTickOfBar)
    Print(Time[0]);
    }

    The above code produces a time print each tick. Is this new to beta7, or am I missing something?

    #2
    - what timeframe is this? 1 minute?
    - which instrument?
    - CalculateOnBarClose true/false?
    - realtime/historical?

    Thanks

    Comment


      #3
      The Indicator is designed to only work with RealTime data

      - what timeframe is this? 1 minute?
      I have tried multiple Volume periods(1000,25000,7000), and multiple time periods (1,5,10)
      - which instrument?
      ES 03-10
      - CalculateOnBarClose true/false?
      true
      - realtime/historical?
      realtime

      Comment


        #4
        Originally posted by tquinn View Post
        - CalculateOnBarClose true/false?
        true
        Hmm .. am I missing something? This would make OnBarUpdate only triggers once per bar right? Meaning, I saw an output in every new bar of my test on 1 min ES.

        Comment


          #5
          This code works OK in a new indicator. Yet the same structure in a b6 indicator worked fine, in b7 it does not. And no info in the Log. ???

          I don't know. I'm still trying to narrow it down.

          protected override void OnBarUpdate()
          {
          if( ! Historical)
          {
          if(FirstTickOfBar) Print(Time[0]+" ");
          }

          }

          Comment


            #6
            I see. Strange. May be stripping down your B6 indicator to isolate the culprit helps..

            Comment


              #7
              I answered wrong earlier. This is set to CalculateOnBarClose=false, not true. The following code in a new indicator is producing a time print each tick. Should it not just be once per bar?

              namespace NinjaTrader.Indicator
              {
              [Description("Enter the description of your new custom indicator here")]
              public class QTFTOB : Indicator
              {

              protected override void Initialize()
              {
              CalculateOnBarClose = false;
              }

              protected override void OnBarUpdate()
              {
              if( ! Historical)
              {
              if(FirstTickOfBar)
              {
              Print(Time[0]);
              }
              }
              }

              }
              }
              Attached Files

              Comment


                #8
                Looks like a bug. We'll look into. Thanks for reporting.

                Comment


                  #9
                  Is there a way I can roll back to b6?

                  Comment


                    #10
                    Could you please fire me a mail to "dierk AT ninjatrader DOT com"? Thanks

                    Comment


                      #11
                      Done! thanks.

                      Comment


                        #12
                        So, is FirstTickOfBar not working correctly for V7B7?

                        And if so, is there a workaround on this?

                        If not, I'm dead in the water with my testing, as several of my indicators rely on this feature.

                        Comment


                          #13
                          >> So, is FirstTickOfBar not working correctly for V7B7?
                          Unfortuantely that is the case. I'm not aware of a work around.

                          Comment


                            #14
                            KBJ,

                            Workaround = check CurrentBar # and the first time it changes, have your own bool that switches to false.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              Dierk: Thanks for your speedy answer.

                              Since this is such a core-functionality of the product, can we hope for a rapid, next beta release with this fixed?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              601 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              347 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              103 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              559 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              558 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X