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

Enhanced Heiken Ashi indicator

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

    #61
    Originally posted by ETFVoyageur View Post
    ... One of them is being sure the environment is up to date.
    To stick my foot in it, I just deleted the indicator, downloaded the version from #45, and it again imported from the zip file, with no problem at all. So, let us compare our actual environments.
    • Windows XP SP3 - (32-bit)
    • .NET frameworks: 1.0.3705, 1.1.4322, 2.0.50727, 3.0, 3.5 SP1 (see attached graphic. The first and last items are not .NET: they are there to show that all the .NET components are listed - sort of like how one would peruse an alphebetical listing).
    • NT 7.0.1000.2

    This is hardly a clean system. In fact, it is filled with detritus from various places, half finished programs in various languages; unfinished NT indicators and strategies; multiple beta browsers etc. I think I even had .NET 4.0 installed at one time and uninstalled it for some reason. The point I am making here is that we do should not need to get a clean, freshly installed system to use for testing. If my system this dirty functions fine, the problem has to be very highly specific.
    Attached Files

    Comment


      #62
      And right there we hit the Global namespace pollution problem caused by indicators from different vendors.

      Comment


        #63
        So, let us compare our actual environments.
        Win 7
        .NET framework 4 (via Help/About on NT it lists ".NET/CLR Version: 2.0.50727.4952")
        NT 7.0.0.22

        PS: Ok have now downloaded NT 7.1000.2

        But I get the same Import failure and same errors as post # 59 when building each cs. file.

        hth, thx
        Last edited by dj22522; 02-08-2011, 05:37 PM. Reason: see PS:

        Comment


          #64
          *) You should be able to download the latest NT from


          We have established that is not the problem (see below), but I'd get up to date anyway just on general principles if I were you.

          *) Your file edits look fine. I'm glad to see that you just commented out those lines -- I meant to suggest that.

          PROBLEM SOLVED:

          MR. K is right -- your error is due to global namespace pollution, by TickCounter2
          • The author of TickCounter2 has been a Very Bad Boy. He put something into the global namespace without making any reasonable effort to ensure that the name would be unique.

          • The reason my name is not "uniquified" is that it was intended to be inside a namespace, which was properly uniquely named.

          In fact, now that I think of it, that is your whole problem. Once you had my definitions visible, you had TWO visible instances of the enum DisplayLocation simultaneously visible (the global namespace is always visible), and his almost certainly does not have my names (Chart_Panel, Indicator_Panel).

          I think we have solved the problem -- the Very Bad Boy has messed up. As I see it, your choices are:

          1) Fix the issue as (IMHO) it should be fixed:
          • Get the name of the enum in TickCounter2 fixed -- either you do it or you get the author to do it. The enum name must be changed to something that is more socially responsible (i.e. uniquely named). Perhaps something like "TC2_DisplayLocation".

            • This REALLY should be done. It is socially irresponsible to put non-unique names into the global namespace. This is not the Wild Wild West where the first guy on the scene has a claim to the name. If the TickCounter2 name is left alone, it will just conflict with something else one of these days.


            • If you do it yourself, that means recompiling it and fixing any references to the old name. Should be pretty easy to do. Of course, you'll have to do it over again if you download an update to TickCounter2. That's why it is better to get the author to change to a unique name and then use that revised code.


            • Alternatively, the TickCounter2 enum could also go inside a suitably uniquely named namespace. The reason I do not advise that is because NT considers it an unsupported way to solve the problem. I may do a few unsupported things myself, but I do not advise others to do that.


          • Restore my code to the way it was shipped. There is nothing wrong with the way it was. NT advises no namespaces, but that gets you into the global namespace pollution you just ran into unless everybody plays nice. Some of us have been pushing to use the namespace as I did in my code. No one has ever shown it to be a problem, or given any technically good reason not to do it that way.

          2) Alternatively, you can change the enum name in my files so that it does not conflict with TickCounter2
          • You can restore the namespaces or not, as you choose. They never were the problem, but leaving them out is fine too as long as you get the names un-conflicted.

          • If you go this route, you will have to make the same change with any updates I issue. I do not plan to change the name in my code, because the problem is TickCounter2 failing to choose a global namespace name with any realistic chance of being unique. My name is fine when in its namespace.

          OK -- choose whichever route you want. Either one should fix your immediate problem. Let us know how it goes.

          -- EV
          Last edited by ETFVoyageur; 02-08-2011, 05:53 PM.

          Comment


            #65
            Originally posted by ETFVoyageur View Post
            *) You should be able to download the latest NT from


            We have established that is not the problem (see below), but I'd get up to date anyway just on general principles if I were you.

            *) Your file edits look fine. I'm glad to see that you just commented out those lines -- I meant to suggest that.

            PROBLEM SOLVED:

            MR. K is right -- your error is due to global namespace pollution, by TickCounter2
            • The author of TickCounter2 has been a Very Bad Boy. He put something into the global namespace without making any reasonable effort to ensure that the name would be unique.

            • The reason my name is not "uniquified" is that it was intended to be inside a namespace, which was properly uniquely named.

            In fact, now that I think of it, that is your whole problem. Once you had my definitions visible, you had TWO visible instances of the enum DisplayLocation, and his almost certainly does not have my names (Chart_Panel, Indicator_Panel).

            I think we have solved the problem -- the Very Bad Boy has messed up. As I see it, your choices are:

            1) Fix the issue as (IMHO) it should be fixed:
            • Get the name of the enum in TickCounter2 fixed -- either you do it or you get the author to do it. The enum name must be changed to something that is more socially responsible (i.e. uniquely named). Perhaps something like "TC2_DisplayLocation".

              • This REALLY should be done. It is socially irresponsible to put non-unique names into the global namespace. This is not the Wild Wild West where the first guy on the scene has a claim to the name. If the TickCounter2 name is left alone, it will just conflict with something else one of these days.


              • If you do it yourself, that means recompiling it and fixing any references to the old name. Should be pretty easy to do. Of course, you'll have to do it over again if you download an update to TickCounter2. That's why it is better to get the author to change to a unique name and then use that revised code.


            • Restore my code to the way it was shipped. There is nothing wrong with the way it was. NT advises no namespaces, but that gets you into the global namespace pollution you just ran into unless everybody plays nice. Some of us have been pushing to use the namespace as I did in my code. No one has ever shown it to be a problem, or given any technically good reason not to do it that way.

            2) Alternatively, you can change the enum name in my files so that it does not conflict with TickCounter2
            • You can restore the namespaces or not, as you choose. They never were the problem, but leaving them out is fine too as long as you get the names un-conflicted.

            • If you go this route, you will have to make the same change with any updates I issue. I do not plan to change the name in my code, because the problem is TickCounter2 failing to choose a name with any realistic chance of being unique.

            OK -- choose whichever route you want. Either one should fix your immediate problem. Let us now how it goes.

            -- EV
            Good grief. How did you find this out !! ??

            No mind, I took a slightly easier path and just deleted the TtickCounter2 indicator.

            Ground control to Major Tom..."RwbHA has Imported, the eagle has landed"


            Needless to say, my sincere thanks EV et al.

            PS: feel free to delete my posts to free up your thread, other than some reference to this being a issue.
            Last edited by dj22522; 02-08-2011, 05:54 PM.

            Comment


              #66
              ... Get the name of the enum in TickCounter2 fixed -- either you do it or you get the author to do it. The enum name must be changed to something that is more socially responsible (i.e. uniquely named). Perhaps something like "TC2_DisplayLocation"...
              Or just force the enum into a named namespace in the manner that EV and I have been doing so far:
              1. create a namespace in the file
              2. move the enums in there
              3. create a using directive to use the namespace

              IOW, get that thing out of the global namespace, to save yourself grief down the line. This is CS101.

              Comment


                #67
                Originally posted by dj22522 View Post
                Good grief. How did you find this out !! ??

                No mind, I took a slightly easier path and just deleted the TtickCounter2 indicator.

                Ground control to Major Tom..."RwbHA has Imported, the eagle has landed"


                Needless to say, my sincere thanks EV et al.

                PS: feel free to delete my posts to free up your thread, other than some reference to this being a issue.
                "Intuitively obvious to the casual observer", as they say. Your error message said there were two DisplayLocation's in the global namespace, and gave the name of the file with the other one. As soon as I saw that I knew the problem.

                It does not matter whether or not TickCounter2's name is an enum -- just that it is non-uniquely named and it is in the global namespace.

                --EV

                Comment


                  #68
                  Is it not rather shocking that we spent all this time trying to resolve an issue that we anticipated and even kvetched about on this very forum? I can but hope that this is a good lesson in why the Global namespace should not be polluted all willy-nilly.

                  Why is my mouth itching so hard to yell: "I told you so!"?

                  Comment


                    #69
                    @dj22522

                    BTW: it would be a Good Thing if you let the originator of TickCounter2 know that they have a problem that needs fixing -- that global symbol name has Got To Go. They should either:
                    • (NT supported) change the symbol to one that is unique

                    • (Unsupported, but some prefer) put the symbol in a namespace as Mr. K has described.

                    --EV

                    Comment


                      #70
                      Originally posted by koganam View Post
                      Is it not rather shocking that we spent all this time trying to resolve an issue that we anticipated and even kvetched about on this very forum? I can but hope that this is a good lesson in why the Global namespace should not be polluted all willy-nilly.

                      Why is my mouth itching so hard to yell: "I told you so!"?
                      I didn't know...lol

                      Shalom


                      Originally posted by ETFVoyageur View Post
                      "Intuitively obvious to the casual observer"
                      My ignorance knows no bounds.
                      I think it was Milan Kundara who wrote
                      "most of life happens to us while we are busy looking the other way"

                      Originally posted by ETFVoyageur View Post
                      @dj22522

                      BTW: it would be a Good Thing if you let the originator of TickCounter2 know that they have a problem that needs fixing -- that global symbol name has Got To Go. They should either:
                      • (NT supported) change the symbol to one that is unique

                      • (Unsupported, but some prefer) put the symbol in a namespace as Mr. K has described.

                      --EV
                      I can't re-call where/when I downloaded it. I'll do a search and try to educate.!

                      Comment


                        #71
                        EV - I can't find your indi file which works for NT7.4, would you pls. guide me to which thread you've posted that file?

                        Regards,
                        Taajir

                        Comment


                          #72
                          I cannot seem to find the file either to download this indicator for Heikin Ashi Candlesticks. I am using Ninja Trader 7 also.

                          Please point me in the right direction?

                          Thanks

                          David

                          Comment


                            #73
                            Advanced Heiken Ashi for NT 7.0

                            email me @ [email protected]...I will send.

                            ~Mongo

                            Comment


                              #74
                              do you have one for NT 8?

                              Comment


                                #75
                                Hello babouin77,

                                Thank you for your reply.

                                I'm not seeing a version of this for NinjaTrader 8 anywhere on the publicly available User App Share. There is a download of the NinjaTrader 7 version on post #25 of this thread that you could certainly convert to NinjaTrader 8 yourself:



                                If you decide to convert this yourself, the Code Breaking Changes page of our help guide should be helpful:



                                It doesn't appear the original author has been active on the forum since 2017, but you could try sending them a private message to see if they'd ever converted it to NinjaTrader 8.

                                Please let us know if we may be of further assistance to you.
                                Kate W.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by mmenigma, Today, 02:22 PM
                                0 responses
                                1 view
                                0 likes
                                Last Post mmenigma  
                                Started by frankthearm, Today, 09:08 AM
                                9 responses
                                34 views
                                0 likes
                                Last Post NinjaTrader_Clayton  
                                Started by NRITV, Today, 01:15 PM
                                2 responses
                                9 views
                                0 likes
                                Last Post NRITV
                                by NRITV
                                 
                                Started by maybeimnotrader, Yesterday, 05:46 PM
                                5 responses
                                26 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by quantismo, Yesterday, 05:13 PM
                                2 responses
                                21 views
                                0 likes
                                Last Post quantismo  
                                Working...
                                X