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

Can I "read" Fibonacci circle plots?

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

    Can I "read" Fibonacci circle plots?

    Scenario:

    I draw Fibonacci circles on my chart. I can visually see the circle lines on my chart but can an indicator get the price plots as well?

    I doubt it but thought I would ask.

    Cheers

    #2
    Hello ct, and thank you for your question. Every drawn object on a chart, including Fibos , can be accessed through the DrawObjects array,



    To see specific information about the drawn object, you will want to review IDrawObject,



    or re-cast as a Fibo,



    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      JessicaP

      Thanks very much for the prompt reply. It is not the Fibonacci drawing object I want to know about but it's plots is what I want to know/retrieve.

      Example:

      I have a fib circle and it has a 100% line defined. Can I get the value of that line plot at a particular bar? I was hoping to piggyback on Ninjas drawing object and not have to compute the proper circle geometry myself to figure out what price that 100% line was at on a particular bar. I will need the fib drawing attributes to compute this value but since the indicator drew the fib circle it has all those values already.

      Circle geometry here I come. Let's see when the diameter is 1, the circumference is 3.141592654(pi), Circumference = 2 × π × Radius, Circumference / Diameter = π.

      It's coming back to me now like mt first home phone number. Nah that's not true I remember my first phone number from 40+ years ago. i digress....

      Cheers Jessica

      Comment


        #4
        Thank you for clarifying. Since a Fibonacci Circle only contains a start and end anchor, you would have to use math to determine what values there are at different price points. This may help.

        Code:
        [FONT=Courier New]            foreach(IDrawingTool tool in DrawObjects)
                    {
                        FibonacciCircle fibCircle = tool as FibonacciCircle;
                        if (null != fibCircle)
                        {
                            int dx = Math.Abs(fibCircle.EndAnchor.BarsAgo - fibCircle.StartAnchor.BarsAgo);
                            double dy = Math.Abs(fibCircle.EndAnchor.Price - fibCircle.StartAnchor.Price);
        
                            Print("Let's see the price intercept 1 bar in from the left of the fib circle");
                            double adjacent = (dx/2) - 1;
                            double hypotenuse = Math.Sqrt(Math.Pow(dx/2, 2) + Math.Pow(dy/2, 2));
                            double angle = Math.Acos(adjacent / hypotenuse);
                            double opposite = hypotenuse * Math.Sin(angle);
                            Print("The price intercept is " + opposite + Min(fibCircle.StartAnchor.Price, fibCircle.EndAnchor.Price) + (dy/2);
                        }
                    }[/FONT]
        Last edited by NinjaTrader_JessicaP; 02-06-2017, 08:02 AM.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Jessica

          Thank you very, very much. You keep raising the bar on my expectation of support Ninja support.

          Cheers

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,227 views
          0 likes
          Last Post xiinteractive  
          Started by andrewtrades, Today, 04:57 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          7 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          440 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          12 views
          0 likes
          Last Post FAQtrader  
          Working...
          X