Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug in BarsRequired and/or Min. Bars Required

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

    Bug in BarsRequired and/or Min. Bars Required

    I was told to add "BarsRequired = 50" to prevent invalid indicator calculations and chart indicator displays. I was also told that MinBarsRequired Does Not prevent things from happening before the requested bar...apparently, you need both.
    There is a bug somewhere in the logic.

    Please see NT-Bug43.Jpg - The output here is exactly the same as a previously posted problem. I have BarsRequired = 50 in the Init section. I also have Min Bars Required set to 50.

    Note: The "BarsRequired = 50" seems to have been completely disregarded. The chart still starts around bar 20-22 instead of 50. The Indicators are also way off.
    Some trades were also missed!

    #2
    There is no bug.

    Please understand there is a difference between BarsRequired being set in a strategy and BarsRequired being set in an indicator. Setting BarsRequired in a strategy does not carry over to indicators. They are two separate things.

    Please refer to the Help Guide:
    Indicator: http://www.ninjatrader.com/support/h...rsrequired.htm
    Strategy: http://www.ninjatrader.com/support/h...srequired2.htm

    Only the strategy BarsRequired has an UI option when you run a strategy. That setting in the UI is shown as "Min. bars required". It corresponds to BarsRequired as done in code for the strategy. To reiterate, this does not carry over to indicators.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Reply Same Thing

      I set everything EXACTLY AS YOU ASKED!!!!!

      The MinBarsRequired is set to 50 in the GUI.
      The BarsRequired is set to 50 in CODE.

      Please read the attached screen dump & text.

      Comment


        #4
        Incorrect. There is no way you could have set BarsRequired to the indicator of LinReg() and still use LinReg() with that same name. LinReg() is a system indicator that cannot be modified. If you made changes to the indicator you would have had to rename it to actually add a line of code for BarsRequired into it.

        Please reread my previous post. There is a difference between BarsRequired in strategy and BarsRequired in indicator. Everything you have been doing so far is in the strategy. You are expecting setting BarsRequired in a strategy to carry over into an indicator. This will not happen. Indicators have their own BarsRequired setting that needs to be done from the indicator directly.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Would someone please Actually read the post And the NT-Bug43.Jpg attached to it?

          I THINK I HAVE TRIED EVERYTHING AS OUTLINED IN SEVERAL REPLIES!!!

          Note: on the attached screen dump NT-Bug43.Jpg...
          The GUI/Optimize/Min.bars required is set to 50.
          The Code/Init section BarsRequired is set to 50.

          Why is the chart displaying indicators around bar 20?
          Why are the indicators being calculated around bar 20?
          Why is the chart displaying bogus LinReg() values?
          Why is the chart taking about 200 bars to finally come close to the real values?
          Why is the LinReg() Flat Lined for several hundred bars?
          Why does the LinReg() display suddenly display properly somewhere around day 2 or 3...(I don't know the exact submitted JPG file)...but I submitted it too.
          ChuckAllen,

          I do not know why you feel we do not read your posts. We have definitely read your posts and have been explaining this to you across all of the threads you have opened.

          There is a huge difference between BarsRequired in strategy code versus indicator code. Everything you have done is in relation to strategies and nothing in relation to indicators.

          Please review the difference in the Help Guide:
          Indicator: http://www.ninjatrader.com/support/h...rsrequired.htm
          Strategy: http://www.ninjatrader.com/support/h...srequired2.htm

          Indicator BarsRequired = The number of bars on a chart required before the indicator plots. This is NOT the same as a minimum number of bars required to calculate the indicators values.

          Strategy BarsRequired = The number of historical bars required before the strategy starts processing calls to the OnBarUpdate() method.

          1. Why is the chart displaying indicators around bar 20?
          Because that is what the BarsRequired setting for the indicator defaults to. You have never changed the indicator's BarsRequired. Again, everything you have been doing was for the strategy's BarsRequired. These are not the same.

          2. Why are the indicators being calculated around bar 20?
          Same as #1. Because the indicator's BarsRequired default is 20.

          3. Why is the chart displaying bogus LinReg() values?

          Please see my response here: http://www.ninjatrader.com/support/f...ad.php?t=31725. You are using LinReg() with a period of 35. 35 is greater than the default indicator BarsRequired of 20. Thus you are still plotting the unstable period of the indicator. Only when you reach bar #36 do you have enough bars to accurately calculate LinReg() and only then does the displayed values show correct values. If you don't want to see this unstable period you need to change the indicator's BarsRequired to be >=35 instead of leaving it at the default 20.

          4. Why is the chart taking about 200 bars to finally come close to the real values?
          Please see my response in that same thread again. It is accurate at bar #36, not 200.

          5. Why is the LinReg() Flat Lined for several hundred bars?
          Again, please see the other thread. A y-axis scale will show every value being plotted on that scale. If the values you have on the y-axis range from something very high to something very low then when your values become stabilized at the lower value it will appear flat line when combined with the huge y-axis range required to show the whole plot. This happens because of what has been discussed in #3.

          6. Why does the LinReg() display suddenly display properly somewhere around day 2 or 3...(I don't know the exact submitted JPG file)...but I submitted it too.
          Same as #5.
          Josh P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by burtoninlondon, Today, 12:38 AM
          0 responses
          5 views
          0 likes
          Last Post burtoninlondon  
          Started by AaronKoRn, Yesterday, 09:49 PM
          0 responses
          14 views
          0 likes
          Last Post AaronKoRn  
          Started by carnitron, Yesterday, 08:42 PM
          0 responses
          11 views
          0 likes
          Last Post carnitron  
          Started by strategist007, Yesterday, 07:51 PM
          0 responses
          13 views
          0 likes
          Last Post strategist007  
          Started by StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,982 views
          3 likes
          Last Post jhudas88  
          Working...
          X