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

Pivot indicator coding error?

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

    Pivot indicator coding error?

    I just checked NT's pivot indicator on a daily chart with data supply from Interactive Brokers

    - PivotRangeType Weekly or Monthly
    - PriorDayHLC calculated from DailyBars

    The pivots displayed on the chart are often false as the period that they are calculated from is Friday to Thursday for the weekly charts, and in a similar way monthly pivots for May are calculated from the period March 31 to April 29 instead of April 1 to April 30. I checked for different instruments with different time frames.

    You can easily check the error by switching from Dailybars to CalcFromIntradayData, because the latter will display Pivots correctly.
    Last edited by Harry; 05-23-2008, 11:36 AM.

    #2
    As opposed to Monday through Sunday for example?
    RayNinjaTrader Customer Service

    Comment


      #3
      A suggestion

      I am talking about dailybars method only. The indicator choses the wrong dailybar and is always one day late, so weekly pivots (should be calculated from Monday through Friday data) are calculated from Friday through Thursday data, etc.

      I think I have found a possible reason: Line 111 of the indicator reads

      DateTime intradayBarTime = Time[0].AddSeconds(-1).Date;

      which is fine for Intraday Charts. Maybe ".AddSeconds(-1)" should be left out for daily charts that is if "(!Data.BarsType.GetInstance(Bars.Period.Id).IsIntr aday)"


      Comment


        #4
        We will look into and let you know.

        Comment


          #5
          Hi Harry !

          You are correct. Pivots was calculating the weekly and monthly pivots on daily data base incorrect. We fixed this and the fix will be available with the next update.

          Thanks for reporting !

          Kind regards,
          Christian
          ChristianSenior Software Developer

          Comment


            #6
            Please also check Weekly Pivots on Intraday Charts

            Hi Christian,

            in between I found that there also is a bug (maybe the same) for Weekly Pivots/DailyBars Method on Intraday Charts. You will find it, if you plot it against Weekly Pivots/CalcFromIntraDay Method, which should give you a correct value, if you choose an instrument with a session included between 0:00 and 24:00 of your local time. Daily/Monthly Pivots with DailyBar method on intraday charts seem to be correct.

            Comment


              #7
              Hi Harry !

              We will look into and let you know.

              Kind regards,
              Christian
              ChristianSenior Software Developer

              Comment


                #8
                NT Pivots Indicator not working properly ?

                NT version used 6.5.1000.6, data supply from IB.

                I have tested the Pivots Indicator that comes with NT with IB data for FOREX and a number of futures contracts.

                The testing has been only done with the DailyBars method, not with the CalcFromIntradayData method. This is the result for the sample.

                Daily Pivots 100% correct
                Weekly Pivots 29% correct, 71% false
                Monthly Pivots 68% correct, 32% false

                Correct and false refers to the data displayed on the daily chart for the main Pivot (PP) as supplied by IB. My own modified indicator achieved 100% accuracy for the sample, which makes me think that the NT indicator might have some coding errors.

                Details of the test below. It shows that the Daily Pivots of NT are reliable, whereas the Weekly and Monthly Pivots are inconsistent. The indicator would even produce different results for the same Pivot on daily and intraday charts.

                I assume that I do not have an old version of the NT Pivots indicator, as I regularly update NT?

                If I missed anything, please correct my findings. I would appreciate, if you checked the results. All Pivots shown are as of today / 09-25-2008.
                Attached Files

                Comment


                  #9
                  You have a column where you have set as "calculated". How have you determined these values?
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Pivot calculation was made from IB data

                    Opened a daily chart, examined the bars visually, and then with the help of the data box determined High, Low and Close for the Week or the Month. PP was calculated as (H+L+C)/3.

                    So for calculating I used the same IB data as available to the indicator via DailyBars method.

                    Comment


                      #11
                      We will look into it.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi Harry,

                        In the calculation of Weekly and Monthly range type on daily bars was a bug which is now fixed. The fix will be available with the next update of NT.

                        Thanks for reporting !
                        Christian
                        ChristianSenior Software Developer

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Davidtowleii, Today, 12:15 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post Davidtowleii  
                        Started by guillembm, Yesterday, 11:25 AM
                        2 responses
                        9 views
                        0 likes
                        Last Post guillembm  
                        Started by junkone, 04-21-2024, 07:17 AM
                        9 responses
                        68 views
                        0 likes
                        Last Post jeronymite  
                        Started by trilliantrader, 04-18-2024, 08:16 AM
                        4 responses
                        20 views
                        0 likes
                        Last Post trilliantrader  
                        Started by mgco4you, Yesterday, 09:46 PM
                        1 response
                        12 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Working...
                        X