• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get price of Fibonacci levels

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

    How to get price of Fibonacci levels

    How can I get the price of some fibonacci level?
    eg. I have this code:
    Code:
    IFibonacciExtensions iFibExt = DrawFibonacciExtensions("FibExt_" + patternId, false, pointA.Date, pointA.High, pointB.Date, pointB.Low, pointC.Date, pointC.High);
                                    FibonacciExtensions ext = (FibonacciExtensions)iFibExt;
                                    foreach (NinjaTrader.Gui.Chart.FibonacciLevel level in ext.Levels)
                                        level.Active = false;
    
                                    ext.Levels[0].Active = true;
                                    ext.Levels[0].Value = 0;
                                    ext.Levels[1].Active = true;
                                    ext.Levels[1].Value = 0.68;
                                    ext.Levels[2].Active = true;
                                    ext.Levels[2].Value = 1;
                                    ext.Levels[3].Active = true;
                                    ext.Levels[3].Value = 1.68;
    I'd like to know the price at Level[3] (168%).
    Last edited by Luigio; 03-08-2019, 08:22 AM.

    #2
    Hello Luigio,

    Thanks for your post.

    With reference to this thread: https://ninjatrader.com/support/foru...bonacci-levels, my colleague advised, "This would not be possible in NT7 as the tool was not designed to expose levels in Price.".

    You can calculate these price by using the last value (pointC.High) and taking the difference of PointA - PointB times the % value and either add (or subtract) from PointC as needed. I've attached a screenshot where I have manually applied an extension with some arbitrary values for demonstration purposes, the levels are not meaningful and are not a recommendation are only for education.

    The extension levels drawn are 114%, 123%, 136.8%

    PointA is at the price level of 7123.25

    PointB is at the price level of 7026.00

    PointC is at the price level of 7080.75

    The length is PointA to PointB which is 7123.25 - 7026.00 = 97.25

    The 114% extension would then be 97.25 times 1.14 = 110.865 The 114% line is then plotted at 7080.75 (PointC) - 110.865 = 6969.885.

    The 123% extension would then be 97.25 times 1.23 = 119.6175. The 123% line is then plotted at 7080.75 ( PointC ) - 119.6175 = 6961.1325.

    The 136.8% extension would then be at 97.25 * 1.368 = 133.038. The 136.8% line is then plotted at 7080.75 ( PointC ) - 133.038 = 6947.712.

    (There are minor rounding differences between what I calculated by hand and what the program provided and these are insignificant for the purpose of explaining).

    You can certainly code this using just the three points you use to programmatically draw the extension and then the extension percentages themselves.

    Click image for larger version

Name:	Luigio-1.PNG
Views:	1
Size:	35.5 KB
ID:	1050715
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi thats how I figured it out. Thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NinjaCustomer, Today, 10:06 AM
      3 responses
      7 views
      0 likes
      Last Post NinjaTrader_JoshG  
      Started by crabman777, Today, 09:52 AM
      4 responses
      16 views
      0 likes
      Last Post crabman777  
      Started by Arkadiy_B, Today, 06:43 AM
      0 responses
      4 views
      0 likes
      Last Post Arkadiy_B  
      Started by leontancfa, Today, 06:09 AM
      1 response
      16 views
      0 likes
      Last Post NinjaTrader_PatrickG  
      Started by soulfx, 12-01-2017, 08:44 AM
      3 responses
      1,023 views
      0 likes
      Last Post NinjaTrader_EricB  
      Working...
      X