Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pivot Indicator

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

    #31
    while not entirely intuitive, this makes sense...

    and so now i would need to do the math for all of s1, r1, s2 and r2....

    where can i find these formulae, either in math or in code, as NT calculates them, as I know that there are certain different methods of doing this.

    Comment


      #32
      Hello Andrew,
      There are several ways to calculate the Pivot values. Please refer to the below site which describes the most common method to calculate the pivot points
      JoydeepNinjaTrader Customer Service

      Comment


        #33
        Uing the methodology described, I went about creating my own metrics.


        Day bars are indexed as 1
        Variables are doubles

        protected override void OnBarUpdate()

        {


        high = Highs[1][0];
        low = Lows[1][0];
        close = Closes[1][0];
        range = high - low;


        myPP = ((high + low + close) / 3);
        myR1 = (2 * myPP) - low;
        myR2 = myPP + range;
        myS1 = (2 * myPP) - high;
        myS2 = myPP - range;

        //Returns PP value
        pivotPoint = ((this.PriorDayOHLC().PriorClose[0] + this.PriorDayOHLC().PriorHigh[0] + this.PriorDayOHLC().PriorLow[0]) / 3);

        //Returns R1 value
        resistance1 = ((2 * pivotPoint) - this.PriorDayOHLC().PriorLow[0]);

        //Returns R2 value
        resistance2 = pivotPoint + (this.PriorDayOHLC().PriorHigh[0] - this.PriorDayOHLC().PriorLow[0]);

        //Returns S1 value
        support1 = ((2 * pivotPoint) - this.PriorDayOHLC().PriorHigh[0]);

        //Returns S2 value
        support2 = pivotPoint - (this.PriorDayOHLC().PriorHigh[0] -this.PriorDayOHLC().PriorLow[0]);

        Print(Time[0].ToString() + " R2: " + resistance2.ToString() + " R1: " + resistance1.ToString() + " PP: " + pivotPoint.ToString() + " S1: " + support1.ToString() + " S2: " + support2.ToString());


        Print(Time[0].ToString() + "myR2: " + myR2.ToString() + "myR1: " + myR1.ToString() + "myPP: " + myPP.ToString() + "myS1: " + myS1.ToString() + "myS2: " + myS2.ToString());

        ____________________________________________


        these numbers do not yield identical same pivot/support/resist numbers.

        at this point i am having issues with the amount of time I have spent, because I keep coding and I can not get a the numbers to match based on the manner inw hich I have been advised.

        This is not a complicated piece of code, please advise.

        Thanks,

        Andrew

        Comment


          #34
          Can you please clarify who you connect to for data? This is displayed in the bottom left hand corner of the NinjaTrader Control Center.

          If you disconnect from your data provider, and connect the Kinetick End of Day connection, do you get the results you are looking for?
          MatthewNinjaTrader Product Management

          Comment


            #35
            I am using kinetick at all times.

            Comment


              #36
              Hello alabell,
              The below code calculates the pivots based on daily bars
              Code:
              pivotPoint = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).PP[0];
              While this code is calculating the pivots based on intraday bars.
              Code:
              pivotPoint = ((this.PriorDayOHLC().PriorClose[0] + this.PriorDayOHLC().PriorHigh[0] + this.PriorDayOHLC().PriorLow[0]) / 3);
              As such there can be differences as the data set differs.

              Also please refer to this post which discusses this in details
              JoydeepNinjaTrader Customer Service

              Comment


                #37
                so now we are back to the original formulae which were quoted to me a week or two ago, so please answer this question for me:

                -- If a daily bar is, as it sounds, a one day bar, with a high, low open and close like I might see in a 2 year daily chart that would have aprox. 500 bars:

                what is the proper definition of an intraday bar?

                Thank you kindly.

                Comment


                  #38
                  Hello Andrew,
                  Intraday bars will be the bars built from either tick data or minute data.
                  JoydeepNinjaTrader Customer Service

                  Comment


                    #39
                    pivotPoint = ((this.PriorDayOHLC().PriorClose[0] + this.PriorDayOHLC().PriorHigh[0] + this.PriorDayOHLC().PriorLow[0]) / 3);


                    If the above code is built from intraday bars (minute or tick bars), are these bars then scanned to find a day's high, low and close from which to build your pivot point?


                    alternatively, a day bar simply records a H,L,O,C for the specific date in question?

                    is this the difference?

                    If yes, I suppose I get it, but shouldn't they be the same?

                    if no, then I don't understand how the above code would work to calculate "yesterday's pivot point".

                    Thanks as always.

                    Comment


                      #40
                      Hello Andrew,
                      OHLC calculated from intraday bar can differ from Daily bars. There are several factors like:

                      Daily bars are generally based on RTH session while OHLC built from intraday data uses the charts session template (which can be RTH or ETH or any other custom template) to calculate the OHLC.

                      The closing price of a daily bar is based on the volume weighted average price of the last 30 minutes. In case of intraday data it is the last traded price.

                      The pivots will be calculated anyway, based on what data you provide. If the data set differs the pivot values too will differ.
                      JoydeepNinjaTrader Customer Service

                      Comment


                        #41
                        Originally posted by NinjaTrader_Joydeep View Post
                        Hello Andrew,
                        OHLC calculated from intraday bar can differ from Daily bars. There are several factors like:

                        Daily bars are generally based on RTH session while OHLC built from intraday data uses the charts session template (which can be RTH or ETH or any other custom template) to calculate the OHLC.

                        The closing price of a daily bar is based on the volume weighted average price of the last 30 minutes. In case of intraday data it is the last traded price.

                        The pivots will be calculated anyway, based on what data you provide. If the data set differs the pivot values too will differ.

                        The Close of a daily bar is the VWAP of the last half hour? I had no idea. This surprised me greatly.

                        Comment


                          #42
                          Hello Andrew,
                          To be more specific, closing price is the Settlement price in a daily bar.
                          JoydeepNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by ETFVoyageur, Today, 07:55 PM
                          0 responses
                          4 views
                          0 likes
                          Last Post ETFVoyageur  
                          Started by janio973, Today, 07:24 PM
                          1 response
                          7 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by aligator, 01-06-2022, 12:14 PM
                          4 responses
                          241 views
                          0 likes
                          Last Post john_44573  
                          Started by reynoldsn, Today, 05:56 PM
                          0 responses
                          12 views
                          0 likes
                          Last Post reynoldsn  
                          Started by bortz, 11-06-2023, 08:04 AM
                          51 responses
                          1,995 views
                          0 likes
                          Last Post aligator  
                          Working...
                          X