• 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, 07: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:	24
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 yrch1985, 11-03-2019, 11:49 AM
      8 responses
      92 views
      0 likes
      Last Post aligator  
      Started by Dr3am, Today, 05:10 PM
      0 responses
      2 views
      0 likes
      Last Post Dr3am
      by Dr3am
       
      Started by imalil, Today, 04:28 PM
      0 responses
      4 views
      0 likes
      Last Post imalil
      by imalil
       
      Started by bboyle1234, Today, 03:47 PM
      0 responses
      1 view
      0 likes
      Last Post bboyle1234  
      Started by caveat_lector, Today, 03:46 PM
      0 responses
      7 views
      0 likes
      Last Post caveat_lector  
      Working...
      X