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

Pivots

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

    Pivots

    I am trying to call the Pivots indicator from within another indicator I am building to use the pivot points for some calculations, but I am having difficulty calling the indicator.

    I tried "Pivots(Data.PivotRange.Daily,20);" to no avail. It is telling me it cannot convert "NinjaTrader.Data.PivotRange" to "NinjaTrader.Data.IDataSeries". What is the IDataSeries value I can put in there in order for this to work? Thank you.
    Josh P.NinjaTrader Customer Service

    #2
    Please check out the methods signature provided by Intellisense:
    Pivots(Data.IDataSeries input, int width)

    This means you need to code something like:
    Pivots(Input, 20).PivotRangeType = PivotRange.Daily; // extra code to change pivots type to daily
    double val = Pivots(Input, 20).PP[0];

    Note: the PivotRangeType is not supported yet as a parameter on the Pivots() method, that's why you'll need to the extra code line. We'll look into it and likely support it codewise by fall time frame

    Comment


      #3
      Fabulous. Exactly what I was looking for. It works great thanks.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        This method doesn't seem to work when you try to set two variables to two different range types.

        Pivots(Input, 20).PivotRangeType = PivotRange.Daily; // extra code to change pivots type to daily
        double val = Pivots(Input, 20).PP[0];
        Pivots(Input, 20).PivotRangeType = PivotRange.Weekly;
        double val2 = Pivots(Input, 20).PP[0];

        I was playing around with various Print() throughout to see where it messes up and this is what I've found. The indicator does acknowledge the change in PivotRangeTypes, but it does not recognize that you are calling Pivots twice. Once with the first PivotRangeType and once with the second. It seems to ignore the second PivotRangeType change completely. It takes the Daily and just does both val and val2 on Daily.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Right, this will not work (unfortunately). We will address this issue with 6.5.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by alifarahani, Today, 09:40 AM
          6 responses
          36 views
          0 likes
          Last Post alifarahani  
          Started by Waxavi, Today, 02:10 AM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by Kaledus, Today, 01:29 PM
          5 responses
          14 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Waxavi, Today, 02:00 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by gentlebenthebear, Today, 01:30 AM
          3 responses
          17 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X