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

Draw.FibonacciRetracements()

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

    Draw.FibonacciRetracements()

    Hello,

    I have not been able to make it work yet. But will it looks like fibonacci manual retracement using F8? Are we able to change the % levels in the indicator chart and add new one's like 165% for exemple or we are stuck with preset levels?

    I suppose this thing is going in OnBarUpdate. Why do we need a int startBarsAgo after all you just need the X and Y . Like X for the lowest point (price ) in the chart and Y for the price where you want the line to stop on the Y axis?

    Ty

    #2
    Hello frankduc, thanks for your post.

    The FibonacciRetracement obejct has a PriceLevels property that your script can access. I found this post that already demonstrates getting the value of these price levels:



    Kind regards.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      ChrisL,

      Yes i have found it as well and its working.
      If i click the fibo retracement line in the chart i can access the drawing object proprieties and change the levels.

      But is it possible to include in the code the levels you want to show on your fibo retracement line? 161, 200, 261%, they are not included and must be entered manually. If you refresh the ninjascript those levels disappear unless it is save and than load.

      Frank
      Thank you

      Comment


        #4
        Hello, thanks for your reply.

        I was able to change the PriceLevel elements with this test:

        Code:
                FibonacciRetracements myRetracements;
                protected override void OnBarUpdate()
                {
                    if(State == State.Historical) return;
        
                    myRetracements = Draw.FibonacciRetracements(this, "fib", true, 20, High[20], 2, Low[2]);
                    Print(myRetracements.PriceLevels[0].Value);
                    myRetracements.PriceLevels[0].Value = 100;
                    Print(myRetracements.PriceLevels[0].Value);
                }
        Please let me know if I can assist any further.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          ChrisL,

          Is it limited to 7 price levels? Cause as you can see on the chart attach there is 7 fibo lines but i have one more line code for 424% and it wont show up. It seems eveytime i add a new level, every level between 0 and 76 disappear.

          Also is there a way i can remove the diagonal line?

          Frank
          Thank you
          Attached Files

          Comment


            #6
            Hello frankduc, thanks for your reply.

            Yes, there are 7 levels to the retracements. If you would need a different kind of retracements, a custom drawing tool would need to be made for that.To remove the anchor line, go into the drawing tool settings and change the Anchor color to Transparent.

            Please let me know if I can assist any further.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Chris,

              I meant removing the line in the chart wihout removing the extentions by coding in the indicator. Transparent, users can still click on the line even invisible.

              Comment


                #8
                Hello frankduc, thanks for your reply.

                Unfortunately, I am not aware of a way to do that with the existing Fibonacci indicator. You would need to create a custom drawing tool that does not allow clicking the price anchors.

                Kind regards.
                Chris L.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by DT215, 01-14-2023, 07:59 PM
                4 responses
                132 views
                1 like
                Last Post NinjaTrader_BrandonH  
                Started by ETFVoyageur, Yesterday, 12:52 AM
                2 responses
                32 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by Skifree, Yesterday, 02:50 PM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_Kimberly  
                Started by owen5819, Yesterday, 02:24 PM
                2 responses
                16 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by ETFVoyageur, Yesterday, 10:13 PM
                2 responses
                20 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X