Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

January 08 S&C article "Profit Locking And The Relative Price Channel"

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

    January 08 S&C article "Profit Locking And The Relative Price Channel"

    Attached is the "Bear Range Trailing Stop" indicator as discussed in the January 08 S&C article authored by Leaon Wilson titled "Profit Locking And The Relative Price Channel".

    This indicator is for NinjaTrader Version 6.5 or greater.

    To install:

    1. Download the file to your desktop
    2. Start NinjaTrader
    3. Select the menu File > Utilities > Import NinjaScript
    4. Select the downloaded file saved to your Desktop
    Attached Files
    RayNinjaTrader Customer Service

    #2
    This particular .zip is giving me an error when importing. Anyone else having issues? I'm quite interested in the idea behind this one.

    Comment


      #3
      Are you using NinjaTrader 6.5?
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Apparently not?! Working on that now and will report...

        Comment


          #5
          Upgrading to 6.5 surely did the trick, but interestingly, LinRegSlope no longer plots.

          Comment


            #6
            That is because of the syntax change to the Slope() function in NT6.5. Go bring up your indicator and remove the CurrentBar references.

            If it use to be "...CurrentBar - Period, CurrentBar)" change it to just "...Period, 0)"
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              The applicable lines read:

              {
              LRSlope.Set(Slope(LinReg(Period), CurrentBar - Period + 4, CurrentBar));
              }


              So...:

              {
              LRSlope.Set(Slope(LinReg(Period), Period + 4, 0));
              }

              ? And thank you for the help, Josh.

              Comment


                #8
                Right. Btw. Where did you get LinRegSlope? I have it on my comp too, but forgot what I made it for haha.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by Josh View Post
                  Right. Btw. Where did you get LinRegSlope? I have it on my comp too, but forgot what I made it for haha.
                  Awesome, works like a charm. It comes from the Dec '07 S&C release, paired with the rSquared indicator.

                  Thanks again. I'm sure I'll be back for more.

                  Comment


                    #10
                    LinRegSlope

                    Per the below message I made the change in the code for the LinRegSlope indicator and saved it and closed the window -- see attached image. However the indicator does not display on the chart. I can choose it but the panel is blank. Did I leave out something I need to do? I'm not familiar with code btw.

                    Originally posted by jonesenberg View Post
                    The applicable lines read:

                    {
                    LRSlope.Set(Slope(LinReg(Period), CurrentBar - Period + 4, CurrentBar));
                    }


                    So...:

                    {
                    LRSlope.Set(Slope(LinReg(Period), Period + 4, 0));
                    }

                    ? And thank you for the help, Josh.
                    Attached Files

                    Comment


                      #11
                      Hello,

                      Try adding if(CurrentBar < Period + 4) return; right after OnBarUpdate().

                      You can't access a bar that does not exist yet.

                      This link will help explain:
                      DenNinjaTrader Customer Service

                      Comment


                        #12
                        LinRegSlope

                        I still can't get the indicator to plot..what am I doing wrong? Also is there a way to plot angle value of the Linear regression Line? Thanks!!


                        {
                        if(CurrentBar < Period + 4) return;
                        LRSlope.Set(Slope(LinReg(Period), Period +
                        4, 0));
                        }

                        Comment


                          #13
                          Are there any error messages in the Log tab of the Control Center window when you apply this indicator to a chart?

                          There are no ways to access an angle value for lin reg.
                          RayNinjaTrader Customer Service

                          Comment


                            #14
                            This looks more like the correct Linear Regression Slope

                            The Slope for the Linear Regression posted by anachronist here:


                            ( LinRegSlopeSFX - Linear regression slope super fast calc with option for exponential weighting )

                            matches the Slope indicator in the orignal S&C article (I plotted historical charts and they matched the ones in the article). IMO his formula should replace the one in Ninja

                            Comment


                              #15
                              Thanks for the link and input bkout!
                              BertrandNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by alifarahani, Today, 09:40 AM
                              6 responses
                              36 views
                              0 likes
                              Last Post alifarahani  
                              Started by Waxavi, Today, 02:10 AM
                              1 response
                              17 views
                              0 likes
                              Last Post NinjaTrader_LuisH  
                              Started by Kaledus, Today, 01:29 PM
                              5 responses
                              14 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by Waxavi, Today, 02:00 AM
                              1 response
                              12 views
                              0 likes
                              Last Post NinjaTrader_LuisH  
                              Started by gentlebenthebear, Today, 01:30 AM
                              3 responses
                              17 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Working...
                              X