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

How do i anchor a starting point?

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

    How do i anchor a starting point?

    Hi All,

    I'm trying to "anchor" a starting point, for example, if CurrentBar == o, StartingPoint = Close[0].

    Thereafter i plan connect this point with a pivot point.

    Can someone help me please?

    Regards

    Kaywai

    #2
    Best you post a chart and draw a few lines explaining what you wish to do. There are many ways of drawing lines or indicators based on a reference point. A floor pivot, an opening range or an anchored VWAP are all indicators that are anchored in one way or another.

    Comment


      #3
      Hello kaywai,

      Thank you for your post.

      Are you trying to store the price at bar 0? If so, create a double and store the value in that double. Then use the double for your start y value of your drawing object.

      Comment


        #4
        Hi All,

        The starting point is actually the first pivot. I need to anchor it. The attached chart shows multiple instances of what I'm trying to achieve. Any help is much appreciated.

        Regards

        Kay Wai
        Attached Files

        Comment


          #5
          Kay, the storing would happen as your condition to do so is seen (pivot swing for example found). You could then store for example the price point and barnumber via variables or some more advanced object such as a dictionary / list. Unless the condition is seen again > the values would be held in your variables then.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Originally posted by kaywai View Post
            Hi All,

            The starting point is actually the first pivot. I need to anchor it. The attached chart shows multiple instances of what I'm trying to achieve. Any help is much appreciated.

            Regards

            Kay Wai
            NinjaTrader comes with a zigzag indicator. You could have look at the code - although I feel that the code is somewhat cumbersome.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by elirion, Today, 01:36 AM
            0 responses
            3 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by gentlebenthebear, Today, 01:30 AM
            0 responses
            2 views
            0 likes
            Last Post gentlebenthebear  
            Started by samish18, Yesterday, 08:31 AM
            2 responses
            9 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by Mestor, 03-10-2023, 01:50 AM
            16 responses
            389 views
            0 likes
            Last Post z.franck  
            Started by rtwave, 04-12-2024, 09:30 AM
            4 responses
            32 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Working...
            X