Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StdError, calculate Linear Regression, divisor starts at 0, slope becomes NaN. bug

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

    StdError, calculate Linear Regression, divisor starts at 0, slope becomes NaN. bug

    I think I discovered a bug in the calculation of linear regression in the built-in indicator StdError

    On the reading of the first bar of the data series, the variable named "divisor" will be set to 0, and the calculation of the variable named "slope" will result in a NaN value. The values of intercept and linReg rely on slope, therefore their values are also NaN.

    This only seems to occur on the first bar, but I was using the calculated value of linReg to set the value of my custom series, and then passing that custom series to the SMA method, and that is how I discovered the Nan bug.

    Consider testing the value of divisor inside the IsFirstTickOfBar conditional.

    psuedocode

    Code:
    if (divisor != 0 )
    {	Print("divisor is not 0"); 	}
    else
    {      Print("divisor IS 0, so we set it to 1 ");
    	divisor = 1;
    }

    #2
    Hello balltrader,

    Thank you for reporting this behavior.

    I am currently looking into the issue.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello balltrader,

      I've received a tracking ID for this item.

      The NaN value produced on the first bar of the StdError indicator is being tracked with ID #NTEIGHT-12755.

      As new releases of NinjaTrader become available, please check the release notes for this ID. Below is a public link.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        this has been reported as fixed in version 8.0.14.0 on date May 24, 2018. thank you.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,607 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        9 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        19 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        6 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        15 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X