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 love2code2trade, Yesterday, 01:45 PM
            4 responses
            28 views
            0 likes
            Last Post love2code2trade  
            Started by funk10101, Today, 09:43 PM
            0 responses
            7 views
            0 likes
            Last Post funk10101  
            Started by pkefal, 04-11-2024, 07:39 AM
            11 responses
            37 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Yesterday, 08:51 AM
            8 responses
            44 views
            0 likes
            Last Post bill2023  
            Started by yertle, Today, 08:38 AM
            6 responses
            26 views
            0 likes
            Last Post ryjoga
            by ryjoga
             
            Working...
            X