Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Keltner channel offset

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

    Keltner channel offset

    is there a reason the offset in the default NT Keltner channel cannot be set to <1 ? I know it does decimals because I've tried 1.25, 1.5, etc. I'm looking to have a tighter channel and would to try offsets such as .75 and .6

    I assume this should be possible unless it's something in the calculation of the Keltner channel that I'm not understanding. Any suggestions on how to accomplish this? thanks

    #2
    Hi ts888,

    You are correct that the default Keltner channel can take doubles as the input for the offset. The reason the default Keltner channel indicator only allows numbers greater than one is attributed to this code segment here (located in the Properties region of the code):
    Code:
    [Description("How much to expand the upper and lower band from the normal offset")]
    [Category("Parameters")]
    [Gui.Design.DisplayNameAttribute("Offset multiplier")]
    public double OffsetMultiplier
    {
        get { return offsetMultiplier; }
        set { offsetMultiplier = Math.Max(1, value); }
    }
    Notice on the 'set' line the offsetMultiplier is equal to a minimum of 1. To change the indicator to accept smaller decimals I suggest you change the 1 to a 0.
    Code:
    [Description("How much to expand the upper and lower band from the normal offset")]
    [Category("Parameters")]
    [Gui.Design.DisplayNameAttribute("Offset multiplier")]
    public double OffsetMultiplier
    {
        get { return offsetMultiplier; }
        set { offsetMultiplier = Math.Max(0, value); }
    }
    You are going to need to save the indicator as a different indicator name because the Keltner channel is a system indicator that does not allow for modifications.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by Josh View Post
      Hi ts888,

      You are correct that the default Keltner channel can take doubles as the input for the offset. The reason the default Keltner channel indicator only allows numbers greater than one is attributed to this code segment here (located in the Properties region of the code):
      Code:
      [Description("How much to expand the upper and lower band from the normal offset")]
      [Category("Parameters")]
      [Gui.Design.DisplayNameAttribute("Offset multiplier")]
      public double OffsetMultiplier
      {
          get { return offsetMultiplier; }
          set { offsetMultiplier = Math.Max(1, value); }
      }
      Notice on the 'set' line the offsetMultiplier is equal to a minimum of 1. To change the indicator to accept smaller decimals I suggest you change the 1 to a 0.
      Code:
      [Description("How much to expand the upper and lower band from the normal offset")]
      [Category("Parameters")]
      [Gui.Design.DisplayNameAttribute("Offset multiplier")]
      public double OffsetMultiplier
      {
          get { return offsetMultiplier; }
          set { offsetMultiplier = Math.Max(0, value); }
      }
      You are going to need to save the indicator as a different indicator name because the Keltner channel is a system indicator that does not allow for modifications.
      thanks Josh !! really appreciate it. Have to ask a follow up question though because I'm almost worthless in ninjascript.......how do I save it as a different indicator? I found the line in the code and assumed I'd do a "Save As" or similar to get a different name but the save icon is grayed out because of being a system indicator like you say.

      Comment


        #4
        Open the indicator, right click and press "Save As..."
        RayNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Ray View Post
          Open the indicator, right click and press "Save As..."
          I did that and gave it new name. I then compiled and got successful message. However, I can't seem to access it in the indicators list to apply it to a chart. It is not there. Have looked through entire list. When I got back into "edit ninjascript" I can see it but for some reason it doesn't come up in the list to apply it to a chart. Is there another step I'm missing? Thanks.

          I do know see 2 Keltner Channel indicators but not the one I named and neither of them allow the offset under 1 so those can't be them.
          Last edited by ts888; 10-07-2007, 08:49 AM.

          Comment


            #6
            Originally posted by ts888 View Post
            I did that and gave it new name. I then compiled and got successful message. However, I can't seem to access it in the indicators list to apply it to a chart. It is not there. Have looked through entire list. When I got back into "edit ninjascript" I can see it but for some reason it doesn't come up in the list to apply it to a chart. Is there another step I'm missing? Thanks.

            I do know see 2 Keltner Channel indicators but not the one I named and neither of them allow the offset under 1 so those can't be them.
            ok, apparently it is in there but only shows the new name when I add the indicator so that was the confusion.

            However, the change to the code didn't appear to accomplish the task as it still forces it back to a minimum value of 1 for the offset.

            Comment


              #7
              Originally posted by ts888 View Post
              ok, apparently it is in there but only shows the new name when I add the indicator so that was the confusion.

              However, the change to the code didn't appear to accomplish the task as it still forces it back to a minimum value of 1 for the offset.

              actually everything working perfect now. Sorry for all the posts. Thanks for your help.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              7 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              4 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              12 views
              0 likes
              Last Post Javierw.ok  
              Started by timmbbo, Today, 08:59 AM
              2 responses
              13 views
              0 likes
              Last Post bltdavid  
              Working...
              X