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 kaywai, Today, 06:26 AM
                1 response
                5 views
                0 likes
                Last Post kaywai
                by kaywai
                 
                Started by ct, 05-07-2023, 12:31 PM
                6 responses
                203 views
                0 likes
                Last Post wisconsinpat  
                Started by kevinenergy, 02-17-2023, 12:42 PM
                118 responses
                2,779 views
                1 like
                Last Post kevinenergy  
                Started by briansaul, Today, 05:31 AM
                0 responses
                9 views
                0 likes
                Last Post briansaul  
                Started by traderqz, Yesterday, 12:06 AM
                11 responses
                28 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Working...
                X