Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pivots Indicator

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

    Pivots Indicator

    Hello,

    I'm trying to set up an indicator do show simply 1 or 0 in Market Analyzer if Close[0] is above or below the daily pivot point (mid point).

    I'm using this:

    Code:
    {
                if (Close[0]> Pivots(PivotRange.Daily,HLCCalculationMode.DailyBars,20).PP[0])
                Plot0.Set(1);
    
                else Plot0.Set(0);
            }
    Well, I'm getting only 0 values, what means the indicator is not working properly in Market Analyzer.

    Can anyone help me to identify what is wrong in this code?

    Thanks in advance,
    Rodrigo

    #2
    Hello Rodrigo,

    Thank you for your post.

    The code looks OK, but there may be issues if you have a provider that does not include Daily Bars.

    Perhaps change to:
    Code:
     
    if (Close[0]> Pivots(PivotRange.Daily,HLCCalculationMode.CalcFromIntradayData,20).PP[0])
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hello Ryan,

      I have changed the code and now it works perfectly!

      Its a pitty that my data providers (ESignal + Zenfire) don't provide daily data...

      I still don't understand the difference between pivots calculated using daily and intraday data... but at least I have an indicator that works!

      Thanks anyway.
      Rodrigo

      Comment


        #4
        Glad to hear the code works perfectly.

        Daily bars should be provided by the eSignal connection. You just have to ensure you connect with eSignal first. See here for how NinjaTrader works with multiple connections.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Pivots not displayed in market analyzer

          If I try to display the value of the main pivot PP in the market analyzer, it will just show 0.

          I noticed another strange thing as well:

          Although I had selected CalculateFromIntradayData mode, this selection is ignored by the Market Analyzer, as it tries to display the pivots in DailyBars mode.

          Any ideas? Screenshot is attached.
          Attached Files

          Comment


            #6
            Hi Harry,

            You likely need to increase # bars look back to look back the last couple days. On minute bars, a value of 2880 should then be sufficient but you could try lower values depending on your session boundaries and time of day.

            You could also use higher interval bars, like 60 minutes.

            I see the column header is not changing to reflect CalculateFromIntradayData parameter selected. Is this what you mean by this selection is ignored by the Market Analyzer?
            Last edited by NinjaTrader_RyanM1; 05-11-2011, 10:52 AM.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Thanks for your help. Works with CalculateFromIntradayData.

              I guess that the pivots cannot be called in DailyBars mode.

              Comment


                #8
                Harry,

                DailyBars should work. It is just a matter of having it load enough bars to accommodate enough days for it to have the daily bars for yesterday for calculation in DailyBars mode.

                Attached is a screenshot of my Market Analyzer with Pivots in DailyBars mode with an arbitrarily set 3000 bars back with the indicator running on a 1min series.
                Attached Files
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                66 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                41 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                24 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                27 views
                0 likes
                Last Post TheRealMorford  
                Started by Mindset, 02-28-2026, 06:16 AM
                0 responses
                53 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X