Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pivot indicator montly pivots not correct.

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

    Pivot indicator montly pivots not correct.

    I've determined that the calculations for monthly pivots in the Pivot indicator are off by one day which causes the monthly pivots to be different than expected. My Pivot indicator settings are as follows:

    PivotRangeType: Monthly
    PriorDayHLC: DailyBars

    As an example, if I display monthly bars of the Aussie dollar futures contract built from historical daily data (example historical daily data attached), I get the following values for the month of March 09:

    High: 0.706
    Low: 0.6247
    Close: 0.6924 (the close of 3/31/09)

    The calculated pivot point is (0.706 + 0.6247 + 0.6924) / 3 = 0.6744.

    What I've determined is that the Pivot indicator uses the daily close of 4/1/09 (0.6941) instead of the 3/31/09 close. The March 09 pivot calculation is done in OnBarUpdate on 4/2/09 rather than on 4/1/09. Using the 0.6941 close of 4/1/09 gives a different pivot point:

    NinjaTrader monthly pivot point = (0.706 + 0.6247 + 0.6941) / 3 = 0.6749.

    Since all other monthly floor pivots are based on the pivot point, the error grows with each pivot level calculation.

    I think the problem is caused by these lines of code in the Pivot indicator:

    if (pivotRangeType == PivotRange.Monthly)
    currentMonth = RoundUpTimeToPeriodTime(Time[0].AddSeconds(-1).Date, PivotRange.Monthly);

    which sets the currentMonth after the check for the month change is made. Since the currentMonth is set to the previous day (i.e. AddSeconds(-1)), the logic is always looking two days back when determining a month change.

    Regards,

    David
    dbw451
    Attached Files

    #2
    We will take a look. Thanks.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      David,

      Thank you for bringing this to our attention. This will be fixed in NT7.
      Josh P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rocketman7, Today, 02:12 AM
      5 responses
      23 views
      0 likes
      Last Post rocketman7  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      7 responses
      28 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by samish18, 04-17-2024, 08:57 AM
      17 responses
      66 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by briansaul, Today, 05:31 AM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by PaulMohn, Today, 03:49 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X