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

Creating two Fibonacci Indicators at once

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

    Creating two Fibonacci Indicators at once

    Hi All,

    I got a request from a friend to create a Fibonacci Time Extension using the co-ordinates of a Fibonacci Extension.
    Is there a way to create a CustomDrawingTool, or a way to modify the existing Fibonacci Extension (with maybe an on/off toggle) to draw the Fibonacci Time Extension when the Fibonacci Extension is drawn.

    To break down the flow:
    1. Select DrawingTool (Custom or Fibonacci Extension)
    2. Select point 1, point2 and point 3
    3. Fibonacci Extension is drawn as per usual
    4. Fibonacci Time Extension is drawn using the previous points 1 and 2.

    Thanks in advance.

    #2
    Hello BerndNT,

    Welcome to the NinjaTrader forums!

    This is possible but is going to require some work to isolate the Fibonacci into a new drawing tool.
    The existing fibonacci's are available to view the code of in the NinjaScript Editor in the DrawingTools folder in the FibonacciTools file.

    I've made a basic example of isolating a line from the Lines file into a custom drawing tool as a starting point example.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks,

      I will have a look at it and see if I can get anything going.
      Thanks for referring me in the right direction.

      Comment


        #4
        I actually came across that post already and have that downloaded.
        I was playing around with it, and using static values to see if I could get it to plot, but couldn't get any luck.

        Code:
        public static CustomLine CustomLine(NinjaScriptBase owner, string tag, int startBarsAgo, double startY, int endBarsAgo, double endY, Brush brush)
        {
              Draw.FibonacciExtensions(owner, tag+"fibtest", false, startBarsAgo, startY, endBarsAgo, endY, startBarsAgo, startY);
              return CustomLine(owner, false, tag, startBarsAgo, Core.Globals.MinDate, startY, endBarsAgo, Core.Globals.MinDate, endY, brush, DashStyleHelper.Solid, 1);
        }
        I assume this function is what gets called when you click on CustomLine in the DrawingTools drop down.

        So I added the Draw.FibonacciExtension because to my understanding that should Draw it for me.

        Comment


          #5
          Hello BerndNT,

          You will not be able to call a draw method from a drawingtool script.
          You will need to create your own new drawingtool. Isolate the fibonacci extensions, then add the logic to render the time extensions.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by funk10101, Yesterday, 09:43 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
          5 responses
          551 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by rtwave, 04-12-2024, 09:30 AM
          5 responses
          37 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by funk10101, Today, 12:02 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by GLFX005, Today, 03:23 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Erick  
          Working...
          X