Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Linear regression Slope

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

    Linear regression Slope

    I am interested in the linear regression slope indicator. I found a script written by a couple of guys from NinjaTrader at this web site:
    http://www.traders.com/Documentation...adersTips.html
    It looks nice there in the pictures but ti does not seem to work with 6.5. It fires an error saying that the startBarsAgo cannot be lower than the endBarsAgo.
    In any case, if someone has that script running for 6.5 and wants to post it; it would be nice.
    Thanks!

    #2
    Try swapping the value for the startbarsago and the endbarsago.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      No, that did not do it. This is the line causing the problem.
      LRSlope.Set(Slope(LinReg(Period), CurrentBar - Period + 4, CurrentBar));

      Thanks

      Comment


        #4
        When you use the barsAgo context you can't go to the beginning of the chart with CurrentBar in the manner you have.

        CurrentBar in barsAgo effectively brings you to the beginning of the chart. If you end at the beginning of the chart it just doesn't make sense. Run through the logic again and replace the numbers with where you want it to start and where you want it to end.

        If you start 5 bars ago you need to end maybe 1 bar ago or 0 bars ago. Then you also need to make sure that you don't start pass the total amount of bars in the chart. So your startBarsAgo cannot start pass CurrentBar.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hi, yes, this line did not make sense to me either. I did not write it, someone in your company did and it came from the file distribution that you have somewhere in this web site. I downloaded it yesterday. In a way I was making you guys aware of the bug. My bad for not being explicit, my apologies. In any case, that is why I asked if someone had already fixed it or had an script that actually did the calculation I was interested in (the linear regression slope).
          Thanks!

          Comment


            #6
            The Linear Regression Slope indicator is not a default indicator. It is probably from a indicator pack you downloaded and installed. What happened earlier is that the usage of the Slope() function was different in NT6.0 so now in NT6.5 it changed a bit so the parameters need tweaking to work properly.

            Do you remember which indicator pack you got the LinRegSlope() from?
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              I got it from a file called December2007SC.zip. Don't know if that tells you something. It was part of an article from Stocks and Commodities magazine, issue December 2007. I found it as well here in this web site, but don't recall where.
              Thanks!

              Comment


                #8
                Great. Thanks for the information. I will look into getting the indicator updated.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by Josh View Post
                  Great. Thanks for the information. I will look into getting the indicator updated.
                  Josh,

                  Any luck on getting this Linear Regression Slope indicator to work? I could REALLY use it. Thanks

                  Comment


                    #10
                    It should already be updated in the file sharing section. Let me know if it does not seems otherwise.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      I just looked at it, and the current version of the indicator in the file sharing section has the line of code in question changed to:

                      Code:
                      LRSlope.Set(Slope(LinReg(Period), Period + 4, 0));

                      Comment


                        #12
                        Sill does not work

                        I followed this thread and was told
                        www.ninjatrader.com/SC/December2007SC.zip
                        had been updated, but when I try and run it it crashes
                        Attached Files

                        Comment


                          #13
                          Hello cme4pif,

                          That is because this Indicator was exported using NinjaTrader 6.5.0.9.
                          http://www.ninjatrader.com/support/forum/local_links.php?catid=1&linkid=4

                          If open up the ".zip" file you will see the two files "LinRegSlope" and "Rsquared" that are apart of the file. In NinjaTrader 7 these indicators come preloaded when you install NinjaTrader that is why you are getting a duplicate name method.

                          Open up a chart and right click inside the chart then select Indicators. If you scroll down you will see both indicators that you can apply to the chart.

                          Let us know if we can be of further assistance.
                          JCNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by muratb35, Today, 03:36 AM
                          0 responses
                          3 views
                          0 likes
                          Last Post muratb35  
                          Started by fernlicht, Today, 02:16 AM
                          2 responses
                          13 views
                          0 likes
                          Last Post fernlicht  
                          Started by fernlicht, 04-12-2021, 06:01 PM
                          1 response
                          29 views
                          0 likes
                          Last Post NinjaTrader_PaulH  
                          Started by memonolog, Today, 02:10 AM
                          3 responses
                          8 views
                          0 likes
                          Last Post memonolog  
                          Started by orenytz, Today, 12:25 AM
                          0 responses
                          10 views
                          0 likes
                          Last Post orenytz
                          by orenytz
                           
                          Working...
                          X