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 Function

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

    Pivot Function

    I ran into problems when I tried copying and pasting this sample script for the Pivots() function into the OnBarUpdate() portion of a basic ninjascript :

    // Prints the current pivot point value
    double value = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 20).PP[0];
    Print(
    "The current Pivots pivot value is " + value.ToString());


    The error message said, "No overload method for 'Pivots' takes '3' argument. I have no idea what an overload method is.


    Thanks
    Last edited by Gennaker; 10-08-2011, 10:14 PM. Reason: clarification

    #2
    Originally posted by Gennaker View Post
    I ran into problems when I tried copying and pasting this sample script for the Pivots() function into the OnBarUpdate() portion of a basic ninjascript :

    // Prints the current pivot point value
    double value = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 20).PP[0];
    Print(
    "The current Pivots pivot value is " + value.ToString());


    The error message said, "No overload method for 'Pivots' takes '3' argument. I have no idea what an overload method is.


    Thanks
    When you call an indicator class from another class, you must provide all the required inputs. Intellisense will tell you what they are, or you can look in the indicator, to see all the elements that are listed under "Parameters". Intellisense, unfortunately, in this case can often provide overrides that turn out to be invalid.

    Comment


      #3
      Koganam,

      I'm a noob and am trying to figure out how to actually call out an indicator class. I tried adding these lines to the variables:

      private Data.PivotRange pivotRangeType = PivotRange.Daily;
      private HLCCalculationMode priorDayHLC = HLCCalculationMode.DailyBars;
      privatedouble pp = 0;

      and these lines to the Property section:

      public Data.HLCCalculationMode PriorDayHLC
      {
      get { return priorDayHLC; }
      set { priorDayHLC = value; }
      }

      public Data.PivotRange PivotRangeType
      {
      get { return pivotRangeType; }
      set { pivotRangeType = value; }
      }
      public DataSeries PP
      {
      get { return Values[0]; }
      }

      But it wasn't classy enough. Still getting the overload messge.

      Comment


        #4
        Gennaker,

        I'm not certain but you may be using the NT V6.5 documentations for the Piviots. NT V7 requires a few more arguments, specifically the user defined OHLC values (leave 0 if not using);

        double value = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).PP[0];

        Please see our Help Guide for more information on this Indicator method.: http://www.ninjatrader.com/support/h...tml?pivots.htm
        MatthewNinjaTrader Product Management

        Comment


          #5
          Matthew,

          Yes, that was the problem. I needed 3 more arguments....hey, no big deal...I'm married!

          Thanks,

          Comment


            #6
            Is there a similar Pivots() function in Ninjatrader for Camarilla pivots?

            Comment


              #7
              Gennaker,

              I am happy to assist.

              You could try this link, though it looks like they are for NT 6.5. However, one of the indicators seems to have a work-around to get it to work in NT 7.

              Adam P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rocketman7, Today, 02:12 AM
              1 response
              15 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by briansaul, Today, 05:31 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by PaulMohn, Today, 03:49 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by frslvr, 04-11-2024, 07:26 AM
              6 responses
              106 views
              1 like
              Last Post NinjaTrader_BrandonH  
              Started by trilliantrader, 04-18-2024, 08:16 AM
              6 responses
              26 views
              0 likes
              Last Post trilliantrader  
              Working...
              X