Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fibonacci Fan tool for NT8?

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

    Fibonacci Fan tool for NT8?

    Hi!

    I could really use the Fibonacci Fan tool for NT8. Maybe possible to make on from the existing Fib tools or is there something available already?

    #2
    This tool is not currently available in NinjaTrader 8, however, this would be possible through custom programming.

    Comment


      #3
      Allright. I'll see if I can find someone to help me. My C# skills isn't good enough.

      Comment


        #4
        Originally posted by chrille View Post
        Allright. I'll see if I can find someone to help me. My C# skills isn't good enough.
        Write in to PlatformSupport[AT]NinjaTrader[DOT]com and one of my colleagues on the NinjaScript Team should be able to provide some examples.

        Comment


          #5
          Thanks NinjaTrader_PatrickG, I'll do that!

          Comment


            #6
            Hello chrille,

            My name is Jess and I will be happy to answer any questions that come up while you develop this indicator. As a first step, I would recommend creating a "stock" indicator by visiting New -> NinjaScript Editor, right-clicking Indicator on the right, selecting "New Indicator", following along in the wizard long enough to give your Indicator a name, then clicking "Generate". I would then recommend putting bare minimum code for each of the Fibo drawing tools documented here in your OnBarUpdate method :

            Fibo Retracements

            Code:
            [FONT=Courier New]
            [/FONT][FONT=Courier New][COLOR=#008000]// Draws a fibonnaci retracement[/COLOR]
            [/FONT] [FONT=Courier New]Draw.FibonacciRetracements([COLOR=#0000ff]this[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#800000]"tag1"[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#0000ff]true[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#ff6600]10[/COLOR],[COLOR=#ffffff] [/COLOR]Low[[COLOR=#ff6600]10[/COLOR]],[COLOR=#ffffff] [/COLOR][COLOR=#ff6600]0[/COLOR],[COLOR=#ffffff] [/COLOR]High[[COLOR=#ff6600]0[/COLOR]]);[/FONT]
            Fibo Circle

            Code:
            [FONT=Courier New]
            [/FONT][FONT=Courier New][COLOR=#008000]// Draws a Fibonacci circle[/COLOR]
            [/FONT] [FONT=Courier New]Draw.FibonacciCircle([COLOR=#0000ff]this[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#800000]"tag1"[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#0000ff]true[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#ff6600]10[/COLOR],[COLOR=#ffffff] [/COLOR]Low[[COLOR=#ff6600]10[/COLOR]],[COLOR=#ffffff] [/COLOR][COLOR=#ff6600]0[/COLOR],[COLOR=#ffffff] [/COLOR]High[[COLOR=#ff6600]0[/COLOR]]);[/FONT]
            Fibo Extensions

            Code:
            [FONT=Courier New]
            [/FONT][FONT=Courier New][COLOR=#008000]// Draws a fibonnaci extension[/COLOR]
            [/FONT] [FONT=Courier New]Draw.FibonacciExtensions([COLOR=#0000ff]this[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#800000]"tag1"[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#0000ff]true[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#ff6600]4[/COLOR],[COLOR=#ffffff] [/COLOR]Low[[COLOR=#ff6600]4[/COLOR]],[COLOR=#ffffff] [/COLOR][COLOR=#ff6600]3[/COLOR],[COLOR=#ffffff] [/COLOR]High[[COLOR=#ff6600]3[/COLOR]],[COLOR=#ffffff] [/COLOR][COLOR=#ff6600]1[/COLOR],[COLOR=#ffffff] [/COLOR]Low[[COLOR=#ff6600]1[/COLOR]]);[/FONT]
            Fibo Time Extensions

            Code:
            [FONT=Courier New]
            [/FONT][FONT=Courier New][COLOR=#008000]// Draws a fibonacci time extension object[/COLOR]
            [/FONT] [FONT=Courier New]Draw.FibonacciTimeExtensions([COLOR=#0000ff]this[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#800000]"tag1"[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#0000ff]false[/COLOR],[COLOR=#ffffff] [/COLOR][COLOR=#ff6600]10[/COLOR],[COLOR=#ffffff] [/COLOR]Low[[COLOR=#ff6600]10[/COLOR]],[COLOR=#ffffff] [/COLOR][COLOR=#ff6600]0[/COLOR],[COLOR=#ffffff] [/COLOR]High[[COLOR=#ff6600]0[/COLOR]]);[/FONT]
            I would recommend starting off with retracements as those are going to be the kinds of Fibo fans that you are probably familiar with.

            If you would like the services of a certified NinjaScript consultant, please let us know and I will be happy to ask a more community savvy colleague to weigh in.

            Happy coding and happy trading!
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Extending IDrawObject

              Hi Jess,
              Is it possible / "officially supported by NT" to extend IDrawObject and add a new/custom function DrawGannFann? Something similar to custom bars.

              If yes, please provide links to sample code.

              Thanks in advance.

              Regards

              Vivek

              Comment


                #8
                Thank you for asking, AnkaS.

                We do now directly support creating custom drawing tools, including Fibo fans, in NinjaTrader 8. You will want to investigate this link



                I am attaching a script which contains code that comes with NinjaTrader 8 and a dummied out DrawGannFann method for you to fill in
                Attached Files
                Last edited by NinjaTrader_JessicaP; 10-19-2016, 10:35 AM.
                Jessica P.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Jess.
                  Thanks for your response and dummy code.

                  However clicking on "ExampleFan.cs" leads to message "Invalid Attachment specified. If you followed a valid link, please notify the administrator".

                  Regards

                  Vivek
                  For Anka Software

                  Comment


                    #10
                    If you are on a company or public terminal it may be that your systems administrator is not allowing you to download source code files from the internet. Otherwise you may want to review your browser configuration so that you are able to download code samples from the NinjaTrader forums and other places on the internet.

                    As a convenience, I have pasted the code into a block here. You will want to save it as (My) Documents\NinjaTrader 8\bin\Custom\DrawingTools\ExampleFan.cs

                    Code:
                    [FONT=Courier New]//
                    // Copyright (C) 2016, NinjaTrader LLC <www.ninjatrader.com>.
                    // NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
                    //
                    #region Using declarations
                    using System;
                    using System.Collections.Generic;
                    using System.ComponentModel;
                    using System.ComponentModel.DataAnnotations;
                    using System.Linq;
                    using System.Windows;
                    using System.Windows.Input;
                    using System.Windows.Media;
                    using NinjaTrader.Core.FloatingPoint;
                    using NinjaTrader.Gui;
                    using NinjaTrader.Gui.Chart;
                    using NinjaTrader.Gui.Tools;
                    #endregion
                    
                    namespace NinjaTrader.NinjaScript.DrawingTools
                    {
                        // when creating a custom type converter for drawing tools it must inherit from DrawingToolsPropertyConverter to work correctly with chart anchors
                        public class ExampleFan : Gui.DrawingTools.DrawingToolPropertiesConverter
                        {
                            /// <summary>
                            /// TODO: describe your DrawGannFan method here
                            /// </summary>
                            /// <parameter name="argument">TODO: describe your arguments</parameter>
                            /// <returns>TODO: describe what DrawGannFan returns</returns>
                            public static FibonacciRetracements DrawGannFan(object argument)
                            {
                                // TODO: your code here, then return non-null
                                return null;
                            }
                    
                            public override bool GetPropertiesSupported(ITypeDescriptorContext context)
                            {
                                return true;
                            }
                    
                            public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
                            {
                                // override the GetProperties method to return a property collection that hides extended lines & text alignment properties
                                // since they do not apply to fib circle / time
                                PropertyDescriptorCollection propertyDescriptorCollection = base.GetPropertiesSupported(context) ? base.GetProperties(context, value, attributes) : TypeDescriptor.GetProperties(value, attributes);
                                PropertyDescriptorCollection adjusted = new PropertyDescriptorCollection(null);
                                foreach (PropertyDescriptor property in propertyDescriptorCollection)
                                    if (property.Name != "IsExtendedLinesRight" && property.Name != "IsExtendedLinesLeft" && property.Name != "TextLocation")
                                        adjusted.Add(property);
                                return adjusted;
                            }
                        }
                    }[/FONT]
                    Jessica P.NinjaTrader Customer Service

                    Comment


                      #11
                      Fib Fan NT8

                      Hi there,

                      has anyone had any luck coding a custom fib fan drawing tool for ninjatrader 8?

                      Sparks01

                      Comment


                        #12
                        Hello sparks01,

                        Were you able to install, run, and use the provided ExampleFan.cs in this thread? If any obstacles came up with extending this custom fibo fan, please let us know so we may assist further.
                        Jessica P.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Radano, 06-10-2021, 01:40 AM
                        20 responses
                        616 views
                        0 likes
                        Last Post NinjaTrader_BrandonH  
                        Started by Mizzouman1, Today, 07:35 AM
                        1 response
                        6 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by i019945nj, 12-14-2023, 06:41 AM
                        6 responses
                        67 views
                        0 likes
                        Last Post i019945nj  
                        Started by aa731, Today, 02:54 AM
                        1 response
                        8 views
                        0 likes
                        Last Post NinjaTrader_BrandonH  
                        Started by BarzTrading, Today, 07:25 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post BarzTrading  
                        Working...
                        X