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

Getting & Setting Fib object properties

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

    Getting & Setting Fib object properties

    Hi, my first post here and inevitably I have some questions.

    I have a few friends that use NT and I was looking into the possibility of converting some of my MT4 tools to Ninja. I have read through some of the NT7 help guide but wasn't able to confirm with certainty the answer to a question.

    I have written a few Indicators. Scripts and EAs for MT4 using mql4. One of my Script & Indicator combinations is used to dynamically adjust the anchors for a Fib retracement, to explain: take a typical Fib, values of -38.2, 0, 38.2, 50, 61.8, 100 and 138.2 . . . the anchors are at 0 and 100, my Indicator allows the anchors to be moved to any line pair chosen.

    For example: to use the -38.2 and 100 lines the Fib would be adjusted as follows: 0, 27.6, 55.3, 63.8, 72.4, 100 and 127.6. In mql4 I can adjust the number of lines the Fib is made up from, I can adjust the properties of the lines and the values of the lines .. I can also read all these properties from the Fib object. ( see attached images for examples . . . )

    So my question . . . can I read the values for each of the Fib levels ? can I set the values for each of the Fib values using NinjaScript ?
    Attached Files

    #2
    Hi RaptorUK,

    Thanks for the post and welcome to the NinjaTrader forums. You can access some of these properties by code but not all. Please see this page for what you can use with fib retracements:


    You can write any of these values directly for code-based objects. For manually placed objects, you can typically only read values. Please see here for a general introduction to using IDraw interface.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      Hi RaptorUK,

      You can write any of these values directly for code-based objects. For manually placed objects, you can typically only read values. Please see here for a general introduction to using IDraw interface.
      http://www.ninjatrader.com/support/h...drawobject.htm
      Hi Ryan, it's nice to get a swift reply

      I had already looked at IFibonacciRetracements & DrawFibonacciRetracements() but I see no reference to level values . . . I know that Fibs can be drawn manually with different level values, I have seen them on chart images and I have done it this morning on NT. (see attached)

      Are you saying that they cannot be set via NinjaScript ? and if they can't then what values would be used if I coded an Indicator and created a Fib ? what about setting the colour ?
      Attached Files

      Comment


        #4
        OK, I did a bit of searching . . . looks like NinjaScript is seriously lacking in terms of drawing and adjusting Fibs . .





        . . . pity, any idea what is the likely hood of this being introduced in the near future ?

        Comment


          #5
          Right, unfortunately the individual levels are not available through code. I could not comment on a commitment to change this, but have sent your request to our product development team to be considered in a future release.This is assigned tracking ID # 1369. Thank you for the feedback.
          Last edited by NinjaTrader_RyanM1; 11-04-2011, 08:15 AM.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Hi,

            any news on this ? it's been over 12 months . . . without this I can't code dynamically settable anchors for Fibs and that means I can't move to Ninja . . .

            Comment


              #7
              RaptorUK, Thanks for posting. There is no update but I will be sure to forward your continued interest in this request to our development team.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Thanks for the reply . . . but it's been over 12 months already . . . am I wasting my time ?

                All I want to be able to do is what I have been able to do with MetaTrader for years . . . get the Price and Time of the anchors, get the percentages of the levels . . . set the line parameters, thickness, style and colour and ray on/off . . . I can calculate the rest.

                Comment


                  #9
                  Hello,

                  There will be no change in this area near term. Development is reviewing all suggestion ID's and the demand on them since we have so many of them with our next major release. This process is still on going and we are in development now. There is no information I can provide on this new major release at this time unfortunately other then it will not be a short amount of time before it is released since its a major revision.

                  You may be interested in coding your own fib drawing in your own indicator/strategy. I am not sure if this will work for you however if your strategy/indicator can draw the fib tool itself then it could be done using DrawLine().

                  Comment


                    #10
                    Originally posted by NinjaTrader_Brett View Post
                    You may be interested in coding your own fib drawing in your own indicator/strategy. I am not sure if this will work for you however if your strategy/indicator can draw the fib tool itself then it could be done using DrawLine().
                    What I wanted to be able to do is take a standard manually draw Fib and modify it's anchors, something I have already coded for MT4 . . see images in the first post.

                    Comment


                      #11
                      Hi raptor,

                      You have been a great help to me on the mql4 over the years.

                      I use and draw my own fib levels using the zig zag indicator to find my anchors and have a code that calculates all the fibs that i define and then draws a line for each level. I then add text to label the appropriate lines.

                      If I want the fib to find a different swing I just change the zig zag deviation. (you could set definable anchors in indicator properties for the 0 and 100, instead of using the zz.)

                      My understanding is that you want to be able to access and change the fib levels, so creating the levels, and drawing the levels yourself would give you complete control of all the prices and display characteristics..

                      Would this not solve your issue? Albeit in a roundabout way.....

                      Comment


                        #12
                        Originally posted by marty087 View Post
                        Hi raptor,

                        You have been a great help to me on the mql4 over the years.

                        I use and draw my own fib levels using the zig zag indicator to find my anchors and have a code that calculates all the fibs that i define and then draws a line for each level. I then add text to label the appropriate lines.

                        If I want the fib to find a different swing I just change the zig zag deviation. (you could set definable anchors in indicator properties for the 0 and 100, instead of using the zz.)

                        My understanding is that you want to be able to access and change the fib levels, so creating the levels, and drawing the levels yourself would give you complete control of all the prices and display characteristics..

                        Would this not solve your issue? Albeit in a roundabout way.....
                        Hi Marty,

                        glad to hear I have helped, even a little

                        I have a few friends that trade manually using Ninja, they use Fibs and I was looking to create a script to help them out.

                        Imagine you have a Fib with anchors at 100 and 0 . . . then you want to lock the 50 level onto a candle, so now you want the anchors on the 100 and the 50 . . . I have written code for MT4 that allows me to do this dynamically, I can change the Fib anchors at will . . . this is what I was looking to do with Ninja.

                        Comment


                          #13
                          Originally posted by RaptorUK View Post
                          Hi Marty,

                          glad to hear I have helped, even a little

                          I have a few friends that trade manually using Ninja, they use Fibs and I was looking to create a script to help them out.

                          Imagine you have a Fib with anchors at 100 and 0 . . . then you want to lock the 50 level onto a candle, so now you want the anchors on the 100 and the 50 . . . I have written code for MT4 that allows me to do this dynamically, I can change the Fib anchors at will . . . this is what I was looking to do with Ninja.

                          My understanding of what u want to do is derive other levels from an existing fib...looking at your mt4 pic, am I right in saying that you want to project TP levels based on your originally drawn fib?. You can draw fibs in ninja trader by defining the start y and end y..... You can also read the start y and end y and therefor duplicate your own levels by simply assigning variables to any calculation you like based on the originally drawn fib.... Once you have the individually assigned variables you can then draw the missing lines and text wherever you like.

                          I must not be understanding exactly what you want done, because to me , based on what you have said it seems at though you could just work out virtually where the additional fibonacci levels should go once the 50% anchor becomes your new 0% then just draw those percentages on the original fib settings and name them appropriately.... Eg if 0% anchor changed to 50% then your new 100% line could be difined as 150% of the original swing but labelled as 100%{2nd swing}

                          Comment


                            #14
                            Originally posted by marty087 View Post
                            My understanding of what u want to do is derive other levels from an existing fib...looking at your mt4 pic, am I right in saying that you want to project TP levels based on your originally drawn fib?.
                            Nope, I want all the same levels . . but be able to pick and choose where the anchors are . . .

                            If you look at the first picture on the first post you will see the anchors are at the zero level and 100 level . . . in the 2nd picture they are at the -38 and 100 levels . . . but I want to be able to choose where I have these anchors.

                            I have coded this as an Indicator in MT4, the trend line is used to change the anchor levels, so if the trendline end is moved up to the 50 level the anchor moves there on the next tick.

                            Porting this Indicator over to Ninja, bearing in mind I don't know Ninja Script at all would have taken some time . . . now having to build my own Fib from scratch is obviously even more work and I'm not sure I can spend that much time.

                            Comment


                              #15
                              I am starting to wonder if we are all talking at cross purposes here . . . and if we are it's probably my fault.

                              I've seen another post stating that I can get the price values for the anchors . . that's great, but to be able to calculate where the other levels are at I need to know what the %age values are for the other levels . . . can I get them, can I then set them to something of my own choice ?

                              Finally can I change the text on each level to something of my own choice ?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by CortexZenUSA, Today, 12:53 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post CortexZenUSA  
                              Started by CortexZenUSA, Today, 12:46 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post CortexZenUSA  
                              Started by usazencortex, Today, 12:43 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post usazencortex  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              168 responses
                              2,266 views
                              0 likes
                              Last Post sidlercom80  
                              Started by Barry Milan, Yesterday, 10:35 PM
                              3 responses
                              13 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Working...
                              X