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 indicator

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

    Pivot indicator

    I'm creating my own pivots indicator and use the following line to draw the daily pivot value in OnBarUpdate()

    DrawLine("PP",true,startline,pp,0,pp,Color.Red,DashStyle.Dash,1);

    where startline = first bar of the session

    pp = daily pivot value

    The line seems to be extending back further than the current session, how can I fix this so that the line starts from the current session only?

    #2
    You will need to print out what your startline parameter is and debug it to get it to the correct value to reach the first bar of the session.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      drawline error

      The error was the parameter startline stored the currentbar value at the starpoint (session break) but in terms of bars ago from current bar 0 this is currentbar - startline.

      DrawLine("PP",true,CurrentBar-startline,pp,0,pp,Color.Red,DashStyle.Dash,1);

      Comment


        #4
        Not sure what you mean. What error are you receiving?
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          line error

          Sorry I mean the error is now fixed as I was using the wrong start point value for the line so the above code [currentbar-startline] is the fixed version.

          I have attached an image showing the indicator displaying daily pivot values for the current session. How do I alter the display so that all the price bars are shown but the pivots far from the price do not need to be displayed so the price action is not 'squashed' as shown in the image?
          Attached Files

          Comment


            #6
            Please try setting AutoScale (second DrawLine input) to false.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              fix

              Yes that worked. Thank you.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by morrnel, 05-12-2024, 06:07 PM
              3 responses
              33 views
              0 likes
              Last Post wzgy0920  
              Started by FishTrade, Yesterday, 11:11 PM
              0 responses
              5 views
              0 likes
              Last Post FishTrade  
              Started by Austiner87, Yesterday, 03:42 PM
              1 response
              21 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by cshox, Yesterday, 11:11 AM
              2 responses
              16 views
              0 likes
              Last Post cshox
              by cshox
               
              Started by algospoke, Yesterday, 06:53 PM
              0 responses
              11 views
              0 likes
              Last Post algospoke  
              Working...
              X