Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Maximum Bars Look Back + Comparisons

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

    Maximum Bars Look Back + Comparisons

    CrossBelow(Close,Bollinger(BollStdDev,BollPeriod). Lower,1)
    With Maximum Bars Look Back = 256 does not function the same as
    Maximum Bars Look Back = Infinite

    BollStdDev=2
    BollPeriod=14

    The same is true of:
    Close[0]< Bollinger(BollStdDev,BollPeriod).Lower[0]


    With 256 i get hundreds of signals with infinite i get the same behaviour as NT 6.5

    I think i may missing something fundamental in my understanding - what would that be?
    MicroTrends
    NinjaTrader Ecosystem Vendor - micro-trends.co.uk

    #2
    Hello,

    Thank you for your forum post.

    The setting of Maximum Bar look back will effect your indicator values moving forward with some indicators. What other indicators methods do you use in your strategy?

    You mention that with NT 7 you get hundreds of signals but with NT 6.5 you get the same behavior, this would be true as Maximum bars look back is a new feature in NT7 to help with improving performance for those indicators or strategies that didn't need more then then this to calculate. However 256 bars should be enough bars for this to calculate.

    Is it possible you could post your code for testing on the forum or sending an email to support at ninjatrader dot com and reference this forum post so that we may test this and make sure everything is working as expected.


    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      What I mean is the same code for the same period produces different results

      NT6.5 results are correct
      NT 7.0 with infinity are correct,
      256 is not correct - the conditional statements have inconsistent results for the code posted.

      If it returns true when the other doesn’t....

      I will post some of the source to you - but it will take a while to pull it all out the classes etc - i will also post a image of it to clarify
      MicroTrends
      NinjaTrader Ecosystem Vendor - micro-trends.co.uk

      Comment


        #4
        Hello,

        I received the code and will be taking a look into it shortly.

        Thank You for your patience.
        BrettNinjaTrader Product Management

        Comment


          #5
          it seems to be ok with 30min bars - but 1 through to 15min are not

          this is code being migrated over to 7. perhaps i missed something -
          MicroTrends
          NinjaTrader Ecosystem Vendor - micro-trends.co.uk

          Comment


            #6
            Try adding this to OnBarUpdate()

            PHP Code:
            if (CurrentBars[0] < 1) return; //first data series
            if (CurrentBars[1] < 1) return; // second data series, etc 
            
            That solved some issues I was having with an indicator that didn't play nicely with 1 min bars.

            Just a thought, YMMV, etc.

            Comment


              #7
              issue resolved

              Originally posted by MXASJ View Post
              Try adding this to OnBarUpdate()

              PHP Code:
              if (CurrentBars[0] < 1) return; //first data series
              if (CurrentBars[1] < 1) return; // second data series, etc 
              
              That solved some issues I was having with an indicator that didn't play nicely with 1 min bars.

              Just a thought, YMMV, etc.
              That sounds like a great idea...
              I did eventually resolve it:
              What i actually did was make sure i set the dataseries onbarupdate - to a value even if it wasn't used....

              e.g


              if(entry(true))
              {
              base.Signal(signalStates.signalLong);
              }
              else if(entry(false))
              {
              base.Signal(signalStates.signalShort);
              }
              else
              {
              base.Signal(signalStates.signalNone);
              }
              base.onBarUpdate()
              (does stuff in an inherited class and plots if base.signalDataSeries[0] has a state)

              thank for your reply :-)
              Last edited by MicroTrends; 05-20-2010, 05:57 PM.
              MicroTrends
              NinjaTrader Ecosystem Vendor - micro-trends.co.uk

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              599 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              344 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
              558 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              557 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X