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

Is PercentR indicator available in NT8?

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

    Is PercentR indicator available in NT8?

    Hi there,

    Yesterday in the NT7 forum I asked if the PercentR indicator was available. I have not received a reply so I assume it is not. Is this indicator perhaps available in NT8?

    If not, would it be possible to code it for myself?

    Full description of indicator is here: http://ninjatrader.com/support/forum...d.php?t=103414

    Thanks,
    Michelle

    #2
    Hello michellepace,

    Thanks for your post.

    The Williams%R indicator is available as a standard NinjaTrader provided indicator in both NT7 and NT8. It is shown as "WilliamsR" in the indicators panel.

    Here is the helpguide description of the WilliamsR indicator: "Developed by Larry Williams, Williams %R is a momentum indicator that works much like the Stochastic Oscillator. It is especially popular for measuring overbought and oversold levels. The scale ranges from 0 to -100 with readings from 0 to -20 considered overbought, and readings from -80 to -100 considered oversold."

    Sorry that we did not reply to your earlier post.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Paul View Post
      Hello michellepace,
      The Williams%R indicator is available as a standard NinjaTrader provided indicator in both NT7 and NT8. It is shown as "WilliamsR" in the indicators panel.
      Hi Paul, thank-you that is exactly the indicator I am after. I would however like to modify it so that I graph a histogram rather than a line. Could you please point me in the direction as to how I would do this. That is, could you prefer me to an indicator where a histogram is currently being plotted and I'm sure from that I'll be able to work it out.

      Thanks in advance
      Michelle
      Attached Files

      Comment


        #4
        Hello michellepace,

        Thanks for your reply and glad that is the indicator you need.

        You can change the plotstyle without needing to change the code from Line to Bar within the indicator parameters directly. (True for all indicators with plots, although some would not lend themselves to be histogram like). Please see the attached for what to change.

        To keep this change going forward for each time you use the indicator, left click on the "preset" text in the bottom right of the panel and click Save, that will set the 'defaults' for the indicator to always be applied as plotstyle bar (along with any other settings you choose to change).


        If you still wish/prefer to modify the code, as you mentioned make a copy, then in the copy, change line 49 from:

        AddPlot(Brushes.Goldenrod, NinjaTrader.Custom.Resource.WilliamsPercentR);
        to (example):

        AddPlot(new Stroke(Brushes.Goldenrod, 2), PlotStyle.Bar, NinjaTrader.Custom.Resource.WilliamsPercentR); The 2 is the "width" setting.
        Attached Files
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hi Paul, thanks very much for your reply and sorry for my delayed response. Actually upon closer look, this indicator is not really what I am looking for. If you look at my chart, the %R oscillates in both an upward and downward direction with the "middle" axis being at 50. If you look at yours, %R just oscillates "downward" ... if that makes sense?

          Perhaps can I change the "Base Level" (which is what it is known as in TradeNavigator) or something similarly named - to 50?

          Thanks once again, Michelle
          Last edited by michelle99; 09-06-2017, 04:36 AM.

          Comment


            #6
            Hello michellepace,

            Thanks for your post.

            That is correct, the WilliamsR indicator does oscillate from 0 to -100.

            As the indicator is open source you are welcome to make a copy (save as with a different name) and modify to your needs.

            It looks like all you would need to do is to modify line 62 by adding the value of 50 to the end of the line, for example:

            Value[0] = -100 * (max0 - Close[0]) / (max0 - min0 == 0 ? 1 : max0 - min0) + 50;
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hi Paul,

              Thanks very much for your reply. I've been trying to figure this out for the last few days without having to ask you... but I am afraid I am stuck.

              On line 62 I don't at all have a line of code which looks like
              Code:
              [I]Value[0]    = -100 * (max0 - Close[0]) / (max0 - min0 == 0 ? 1 : max0 - min0) [/I]
              On line 62 of my WilliamsR indicator I have:
              Code:
              [COLOR=SeaGreen] #region NinjaScript generated code. Neither change nor remove[/COLOR]
              I searched the WilliamsR indicator for this line and it is nowhere to be found.

              Am I looking at the correct file, WilliamsR? (see attached)

              Sorry... I am sure I must be making a really stupid mistake somewhere.
              Michelle
              Attached Files
              Last edited by michelle99; 09-08-2017, 12:49 AM.

              Comment


                #8
                Hello michellepace,

                Thanks for your reply.

                The indicator you posted is from NT7. My previous answers and your original question are in NT8.
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks Paul, I thought there was something terribly strange! If you get a minute could you perhaps please help me with the adjustment in NT7? I have not moved over to NT8 yet.

                  Comment


                    #10
                    Hello michellepace,

                    Thanks for your reply.

                    I have not tested, but you can, this change (in bold):

                    Value.Set(-100 * (MAX(High, Period)[0] - Close[0]) / (MAX(High, Period)[0] - MIN(Low, Period)[0] == 0 ? 1 : MAX(High, Period)[0] - MIN(Low, Period)[0])+50);
                    Paul H.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by traderqz, Yesterday, 09:06 AM
                    2 responses
                    15 views
                    0 likes
                    Last Post traderqz  
                    Started by traderqz, Today, 12:06 AM
                    3 responses
                    6 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by RideMe, 04-07-2024, 04:54 PM
                    5 responses
                    28 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by f.saeidi, Today, 08:13 AM
                    1 response
                    8 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by DavidHP, Today, 07:56 AM
                    1 response
                    7 views
                    0 likes
                    Last Post NinjaTrader_Erick  
                    Working...
                    X