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

Issue With Pivot Points - Reproducible

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

    Issue With Pivot Points - Reproducible

    Hello

    I'm using the standard Ninja Pivots indicator in one of my strategies and I'm getting weird (ie inconsistent) results with it. To illustrate the issue, I've created a very basic strategy that draws an UpArrow below a bar if its low is lower than Pivot Point S2 and if its high is above Pivot Point S2. This works well, but not always.

    The code below should generate an UpArrow in the 6B 09-13 10 min bar chart today at 12:40 CET (and at a few other times later in the day) but it doesn't draw a single UpArrow, although the condition is clearly met (S2 is at 1.5306). Why?

    Thanks a lot for any pointers.


    if(Low[0] <= Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).S2[0] && Close[0] >= Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).S2[0])

    {
    DrawUpArrow("Long" + CurrentBar, false, 0, Low[0]- 3*(TickSize), Color.Green);

    }

    #2
    Hello laocoon,

    Thank you for your post.

    I do not see the 12:40 CET bar for the 10 minute 6B 09-13 has a low below S2, however the low is below the S1 and the close is above the S1, perhaps this is what you are looking for?

    If not please respond with a screenshot of your chart attached to your response so I may investigate this matter further.

    Comment


      #3
      Thanks for your reply Patrick, screenshot is attached.
      Attached Files

      Comment


        #4
        Hello laocoon,

        Thank you for your response.

        Please right click in your chart > select Indicators > select the Pivots indicator applied to your chart and please advise what the PriorDayHLC is set to and the PivotRangeType.

        I look forward to your response.

        Comment


          #5
          Hello Patrick

          Thanks for your reply.

          PriorDayHLC is set to: Daily Bars
          PivotRangeType: Daily

          Thanks

          Comment


            #6
            Hello laocoon,

            Thank you for your response.

            You code is set to the following:
            Code:
            Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20)
            Make sure to match your chart indicator to the code and vice versa to view proper comparisons. In this case change either the chart's indicator to CalcFromIntraDay for the PriorDayHLC or change your code to the following:
            Code:
            Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20)
            Please let me know if I may be of further assistance.

            Comment


              #7
              Thanks Patrick. I modified the code of the strategy as per your example, but there still are no arrows on the 6B chart.


              Thanks

              Comment


                #8
                Hello laocoon,

                Thank you for your response.

                Can you provide your full code once more with the changes so I may investigate this matter further?

                I look forward to assisting you further.

                Comment


                  #9
                  Sure, here you go Patrick. Thanks again.

                  if(Low[0] <= Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).S2[0] && Close[0] >= Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).S2[0])

                  {
                  DrawArrowUp("Long" + CurrentBar, false, 0, Low[0]- 3*(TickSize), Color.Green);
                  }
                  Last edited by laocoon; 07-30-2013, 09:42 AM.

                  Comment


                    #10
                    Hello laocoon,

                    Thank you for your response.

                    Do these settings match your chart? I have used DailyBars for PriorDayHLC, Daily for PivotRangeType and a width of 20 and I do not see that the 12:40 CET bar is anywhere near the S2 line.

                    I look forward to your response.
                    Attached Files

                    Comment


                      #11
                      Yes, I have exactly the same settings.
                      Could it be that the Session Template in the Data Series menu has something to do with this?
                      I'm using Default 24/7.

                      Thanks.

                      Comment


                        #12
                        Hello laocoon,

                        Thank you for your response.

                        I tried the Default 24/7 Session Template and the results did not match yours. Who do you connect to for your Futures data?

                        Comment


                          #13
                          Hello Patrick,

                          I'm on Zen-Fire.

                          Thanks

                          Comment


                            #14
                            Hello laocoon,

                            Thank you for your response.

                            This is occurring because the Daily bar has not loaded at 12:40 CET and the current value of the Pivots S2 is actually 0 (zero) at 12:40 CET. The values begin at 14:40 CET on the 10 minute chart.

                            When using HLCCalculationMode.DailyBars it can be expected that a value of 0 is returned when the daily bars have not been loaded yet. Due to the asynchronous nature of this indicator calling daily bars you should only access the pivot values when the indicator has loaded all required Bars objects. To ensure you are accessing accurate values you can use .ContainsValue() as a check. Please visit the following link for additional information: http://www.ninjatrader.com/support/h...nt7/pivots.htm

                            Please let me know if I may be of further assistance.

                            Comment


                              #15
                              Thanks for your detailed explanation Patrick, but there's something I don't understand here.
                              I start trading at 0800 CET every day and the Pivot Points are always in place on all markets and they stay where they are for the whole trading day. This was also the case in the chart I sent you. So, if the Points are drawn in the chart, their values must be accessible for an indicator/a strategy.

                              How can it be that I can see the Pivot Point lines drawn on the chart but that I can't access their values? This makes no sense to me. It can't be that they're only accessible at 1440 CET, since they're calculated based on levels of the prior day's session.

                              Please enlighten me here and show me a way to use them for the whole session.
                              If the Pivot indicator can draw them at any time, I must be able to use their values at any time in my strategy.

                              Thanks a lot.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by f.saeidi, Today, 12:14 PM
                              4 responses
                              10 views
                              0 likes
                              Last Post f.saeidi  
                              Started by ZenCortexHurry, Today, 01:07 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post ZenCortexHurry  
                              Started by ZenCortexHurry, Today, 01:04 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post ZenCortexHurry  
                              Started by Russ Moreland, Today, 12:54 PM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by philmg, Today, 12:55 PM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_ChristopherJ  
                              Working...
                              X