• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pivots - Intermediate (NT7)

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

    Pivots - Intermediate (NT7)

    I am using the standard NinjaTrader provided pivots which are usually sufficient.

    (I have modified it "RoundedToTickSize" which is useful for instruments such as 6J which shows much more decimals on the chart than on the DOM.)

    But sometimes the gap between these pivots is quite huge and some "intermediate" pivot lines in between PP and R1 and PP and S2 would be useful. I'd like to give it a go and create these and if there is interest for this I can then post the result in the files sharing section. Note this would be for NT7.

    I would appreciate if someone could tell me a good formula to calculate these mid-pivot lines? The standard ones are as follows.

    pp = (currentHigh + currentLow + currentClose) / 3;
    s1 = 2 * pp - currentHigh;
    s2 = pp - (currentHigh - currentLow);

    r1 = 2 * pp - currentLow;
    r2 = pp + (currentHigh - currentLow);

    sandman

    #2
    I got a formula for mid pivots and have used one for testing purposes. For NT7 that is. I inserted it into the code, it compiles with no errors but it does not show up any pivot at all.

    What can/should I do?

    What I did specifically is to take the original NT indicator Pivots, and saved it under a new name called PivotsNTPlus. I then added:
    in the Variables Section: private double rmid = 0;
    in the Initialize: Add(new Plot (Color.Black, "RMID"));
    in OnBarUpdate: rmid = 0.5*(pp + r1);
    and RMID.Set(rmid);
    and further down in Properties region:
    [Browsable(false)]
    [XmlIgnore]
    public DataSeries RMID
    {
    get { return Values[7]; }
    }

    sandman

    Comment


      #3
      Hello sandman,

      Thanks for your post(s).

      When you applied the indicator, do you see any error messages posted in the "Log" tab of the control center related to the indicator?
      Paul H.NinjaTrader Customer Service

      Comment


        #4
        Yes, Paul. It says: Error on plotting indicator: Please check the OnBarUpate or the Plot method: Index was outside the bounds of the array.

        Comment


          #5
          Hello sandman,

          Thanks for your reply.

          This would indicate that an index is pointing to something that does not exist. As you have added a plot you would need to make sure that you have added enough for the various arrays. Your 2nd post looks correct to me in terms of what is needed to add another plot so that is not the issue.

          In looking at the indicator code, I think the issue is likely to be the first variable listed as it is an array of brushes and I only count 7. I would add another to that array statement and see if that resolves the issue. Note that this is just a place holder as the actual color is determined by your add plot statement.
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Paul. I vaguely get what you are saying but have a difficulty transferring it into code (I am not really a programmer). I counted 6 arrays total in the original version. And I added 1 for the new mid-pivot makes 7 total, yet you saying you count "only" 7 seems to indicate it now needs 8. ???

            Could you look over the full code which I have attached as a cs file and indicate where I have to add what?

            sandman
            Attached Files

            Comment


              #7
              Hello Sandman,

              Thanks for your reply.

              This is the first line in region variables:

              private SolidBrush[] brushes = { new SolidBrush(Color.Black), repeats 6x times...

              There are a total 7 of new SolidBrush(Color.Black) you need to make a copy and add 1 so that in the array there are 8 of new SolidBrush(Color.Black)

              Of course if you add more pivots you will need to add another one for each pivot added.
              Paul H.NinjaTrader Customer Service

              Comment


                #8
                Paul. Thank you very much. Needless to say that worked immediately.

                sandman

                Comment


                  #9
                  Paul.
                  I am finished with it. I call it PivotsRoundedtoTickSizePlus. Firstly, rounding to tick size is useful for instruments such as 6J. "Plus" because I added pivots in between PP and S1, S1 and S2 and S2 and S3 (same for Resistance). I also added in the Woodie S1 and R1. These additional pivots can be turned on or off with "Addtl pivots" in the Parameters section of the indicator menu.

                  Before posting it in the files sharing section I thought I would check to see if you would test it to see there is nothing untoward that crept in. And secondly I'd like to make sure I am not violating something as NinjaTrader actually holds the copyright on the indicator. I included a note in that respect in the beginning of the code.

                  sandman
                  Attached Files

                  Comment


                    #10
                    Hello sandman,

                    Thanks for your reply.

                    Please feel free to post in the NinjaTrader7 Indicators file sharing are. We appreciate your consideration and welcome your contributions to the community.
                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      Paul. Thanks. I posted it now (though I took the Woodie Pivots out again). Thanks again for your help.
                      sandman

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by PN720, 12-08-2018, 01:20 PM
                      1 response
                      26 views
                      0 likes
                      Last Post NinjaTrader_PatrickG  
                      Started by Mr.Trader, Today, 04:11 AM
                      2 responses
                      12 views
                      0 likes
                      Last Post Mr.Trader  
                      Started by Traderjoe2017, Today, 06:17 AM
                      0 responses
                      7 views
                      0 likes
                      Last Post Traderjoe2017  
                      Started by tony98, Today, 06:05 AM
                      2 responses
                      5 views
                      0 likes
                      Last Post tony98
                      by tony98
                       
                      Started by 3lliot, Today, 01:00 AM
                      2 responses
                      12 views
                      0 likes
                      Last Post 3lliot
                      by 3lliot
                       
                      Working...
                      X