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

    #46
    Originally posted by ETFVoyageur View Post
    I think you are on the right track, and the problem is tied up with namespaces and the enums. As you know from other threads, the lack of reproducibility in builds bothers me. I am very interested in why it builds for me, but not for the OP. I would not expect that this one has anything to do with whatever else is installed.

    I could believe a compiler difference, though, which is why I asked dj22522 to upgrade his system. I would still like to hear whether or not that fixes the problem.

    The situation with the enums is:
    • RwbHA defines its enum, in its own namespace, and has a using directive for that namespace

    • RwbLibrary defines the same enum, with the same values, in a different namespace. RwbHA does NOT have a using statement for that namespace.

    • Why both definitions? Historical accident -- RwbHA had its before the library got one, and since it always compiled for me I never noticed.

    @dj22522 -- I have fixed RwbHA to just use the library version, and have attached an updated export. Please give it a try and let us know how it goes.

    --EV
    Hi EV.
    I have not upgraded NT7 to the later build you mentioned (apologies, dawn began to rise when I was last logged on).

    To give a clean install of your zip (post#45) I deleted all previous instances of the zip and cs. files from post#'s 25 and37.

    Re post#45 zip.
    Did not Import.
    Unzipping and building each cs.file seperatley, RwbLibrary did compile OK.
    RwbHA did not and hopefully the attached will show a screen shot of the errors.

    Continued thx..

    PS: I have just Imported your RwbMA Indicator without problem.
    Also, when trying to Import RwbHA it initially asks (as does NT with all Imports) if I want to install the EMA as one already exists etc., (which I select yes to) however it does not ask regards the T3. (this is all for the Import process and when finished I get the Import Failed dialog box).
    Not sure if any of that is relevant.
    Attached Files
    Last edited by dj22522; 02-08-2011, 12:15 PM.

    Comment


      #47
      At this point, it would seem to be safe to say that the problem is most probably related to ambiguous references; the reverse problem of namespace pollution. One can but wish that it would show up consistently on all systems.

      I think that I am beginning to see why NT wants one to pollute the global namespace, as that will force all clashes immediately into the open. Unfortunately, insisting on global namespace pollution is not the correct response to this kind of problem.

      Comment


        #48
        @dj22522

        There is some history hanging around somehow.

        Looking at first things first. The first error message about not being able to call an abstract base member Initialize().

        Initialize() WAS abstract, but I changed that recently -- I think yesterday. The export, of course, is a consistent set of files, so that should be no problem. I just unzipped the export and looked at RwbLibrary (where the base class is) to be sure I am not mis-remembering, and to be sure there was not some old version hanging around that got packaged up by mistake. The file is fine, and I was remembering correctly -- Initialize() is NOT abstract. See line798
        Code:
         protected override void Initialize()
        From what you say, it sounds as if you did build RwbLibrary before trying to build RwbHA -- right?

        As long as you did that, I have no idea why your build is using out-of-date historical information, or what to do about it. Perhaps someone else (Bertrand?) can chime in and tell us both what is going on.

        --EV

        Comment


          #49
          Originally posted by koganam View Post
          At this point, it would seem to be safe to say that the problem is most probably related to ambiguous references; the reverse problem of namespace pollution. One can but wish that it would show up consistently on all systems.

          I think that I am beginning to see why NT wants one to pollute the global namespace, as that will force all clashes immediately into the open. Unfortunately, insisting on global namespace pollution is not the correct response to this kind of problem.
          Consistency -- AMEN, Brother! Builds need to be reproducible! We need some of that Old Time Religion!

          Ambiguous references -- see my subsequent posting. I seized on looking at the Initialize() call "abstract" issue because that has nothing to do with (possibly) ambiguous references. It looks to me as if the build is picking up old history somehow -- not good. I say that because a recent previous version of RwbLibrary did have Initialize() in the base class as abstract, but not in the version David was building.

          By the way, the current enum issues also have nothing to do with any enum ambiguity -- I removed the local version now that there is the library version that RwbHA can use.

          Global pollution -- unfortunately does not pick up problems immediately when they are with other software that you do not have installed.

          --EV

          Comment


            #50
            Originally posted by ETFVoyageur View Post
            @dj22522

            There is some history hanging around somehow.

            Looking at first things first. The first error message about not being able to call an abstract base member Initialize().

            Initialize() WAS abstract, but I changed that recently -- I think yesterday. The export, of course, is a consistent set of files, so that should be no problem. I just unzipped the export and looked at RwbLibrary (where the base class is) to be sure I am not mis-remembering, and to be sure there was not some old version hanging around that got packaged up by mistake. The file is fine, and I was remembering correctly -- Initialize() is NOT abstract. See line798
            Code:
             protected override void Initialize()


            Attached is snap shot of line 798.

            From what you say, it sounds as if you did build RwbLibrary before trying to build RwbHA -- right?
            Yes
            As long as you did that, I have no idea why your build is using out-of-date historical information, or what to do about it. Perhaps someone else (Bertrand?) can chime in and tell us both what is going on.

            --EV
            No problem. This is totally out of my understanding so apologies that I can only be a spectator here. I really appreciate your effort and having downloaded your RbwMA indicator it is quite apparant that I'm swiming (however out of my depth) with an expert .
            Lol.
            Many thx and kind regards.
            Attached Files

            Comment


              #51
              It's unfortunately hard to deduct what exactly led to the issues - when I try working with latest export posted I get the error that the DisplayType enum does not contain any of the needed definitions - to isolate out I would recommend working this outlined way of handling enums in NinjaScript - http://www.ninjatrader.com/support/f...ead.php?t=3420

              Apart from that, please all ensure that you're working on the latest .NET including offering patches / SP's by Microsoft.
              BertrandNinjaTrader Customer Service

              Comment


                #52
                > I really appreciate your effort ... Many thx and kind regards

                You are welcome. These build issues really bother me, because they should not be happening.

                >Attached is snap shot of line 798.

                The attachment is only a black rectangle for me. I presume that your line 798 of RwbLibrary does not show what I said. If that is true, then that is the first problem to fix. My information is from unzipping the package and looking at the actual file from the package (not what I thought should be there). Please verify that line 798 of RwbLibrary.cs is what I said it is.

                > having downloaded your RbwMA indicator it is quite apparant that I'm swiming (however out of my depth) with an expert

                If you like RwbMA, wait until you see RwbMA2 -- not yet available. It supports dual moving averages with all the flexibility of RwbMA. Also some related things such as added coloring modes for crossovers, vertical shifting of individual moving averages (useful for two closely related moving averages), horizontally displaced individual moving averages (with tails filled in for negative displacement -- gives a different kind of crossover that some find useful), MACD of whatever two moving averages you configure (happens automatically when you put it in an indicator panel), and a few other things.

                (I'm seriously thinking of writing a small manual to package up with it.)

                --EV

                Comment


                  #53
                  Bertrand,

                  Thanks for you time.

                  My Microsoft patches are up to date. I do not know about David's. On general principles, I agree with you though the current issues seem to be compiler/build issues, not .NET issues.

                  My NT version is up to date. Davids is V7, but not quite up to date. I would like to see him update it, just in case there are compiler differences.

                  Before I worry about anything else, I am worried about why David seems to have inconsistent versions of the two files. Nothing else is interesting until that gets resolved.

                  Enums -- that paper you link to is for enum properties, while my enums are for internal use. My enums' current location in namespace makes technical sense, but I am going to restructure them down into the classes themselves and see whether that helps. I did not have that option originally, but now there is a base class I do. (EDIT: I just went back and looked -- some enums fall in each camp.)

                  The HUGE issue, though, is why you, David, and I all have such different build experiences. Regardless of how I have enums laid out in the source, we should all get the same build result -- be it good or bad.

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

                  Comment


                    #54
                    Originally posted by ETFVoyageur View Post
                    > I really appreciate your effort ... Many thx and kind regards

                    You are welcome. These build issues really bother me, because they should not be happening.

                    >Attached is snap shot of line 798.

                    The attachment is only a black rectangle for me. I presume that your line 798 of RwbLibrary does not show what I said. If that is true, then that is the first problem to fix. My information is from unzipping the package and looking at the actual file from the package (not what I thought should be there). Please verify that line 798 of RwbLibrary.cs is what I said it is.

                    > having downloaded your RbwMA indicator it is quite apparent that I'm swimming (however out of my depth) with an expert

                    If you like RwbMA, wait until you see RwbMA2 -- not yet available. It supports dual moving averages with all the flexibility of RwbMA. Also some related things such as added coloring modes for crossovers, vertical shifting of individual moving averages (useful for two closely related moving averages), horizontally displaced individual moving averages (with tails filled in for negative displacement -- gives a different kind of crossover that some find useful), MACD of whatever two moving averages you configure (happens automatically when you put it in an indicator panel), and a few other things.

                    (I'm seriously thinking of writing a small manual to package up with it.)

                    --EV
                    The attachment re: post#50 opens my end.? !
                    I've copy/pasted from the RwbLibrary cs.file below. (I think you have to be logged in to see it).
                    For me line 798 of RwbLibrary.cs is different from your post#48
                    "protected override void Initialize()"

                    Your most gracious with your willingness to share your stuff.
                    Look forward to RwbMA2.

                    Thx

                    Last edited by dj22522; 02-08-2011, 02:23 PM. Reason: added underlined text

                    Comment


                      #55
                      Originally posted by dj22522 View Post
                      I've copy/pasted from the RwbLibrary cs.file below.
                      I do not know why, but that file is not right. To be even more exact, I just went and downloaded the zip file from post #45. I extracted the files and the .cs file is not the one your post shows. Please try again to get the files from #45.

                      --EV

                      Comment


                        #56
                        Bad writing on my part

                        ... Global pollution -- unfortunately does not pick up problems immediately when they are with other software that you do not have installed.
                        Bad writing on my part. I was referring only to the situation with the enums that are on, or being introduced, onto the local build machine.

                        Of course, the larger potential problem of newly imported indicators causing clashes is why the global namespace should remain pristine from user defined stuff, if at all possible. CS101 says there are an infinitesmal number of situations where it may be acceptable to pollute the global namespace.

                        Comment


                          #57
                          Originally posted by ETFVoyageur View Post
                          I do not know why, but that file is not right. To be even more exact, I just went and downloaded the zip file from post #45. I extracted the files and the .cs file is not the one your post shows. Please try again to get the files from #45.

                          --EV
                          I had deleted all cs files, zips prior to unzipping from post # 45.
                          Not sure what happened then. Apologies.

                          So. Again deleted all instances of zip and cs files for Rwblibrary and RwbHA.

                          Unzipped RwbHA from Post # 45.
                          Built Rwblibrary cs. first which again did compile.
                          and now have the same for line 798 as you do:
                          protected override void Initialeze()

                          Built RwbHA cs. next which did not complile and errors attached:

                          Thx
                          Attached Files

                          Comment


                            #58
                            OK -- at least we are on the same page now -- we appear to at least have the same sources. Good.

                            There are two other kinds of things -- the environment and the code. Here is what Bertrand was gracious enough to suggest on that score:
                            It's unfortunately hard to deduct what exactly led to the issues - when I try working with latest export posted I get the error that the DisplayType enum does not contain any of the needed definitions - to isolate out I would recommend working this outlined way of handling enums in NinjaScript - http://www.ninjatrader.com/support/f...ead.php?t=3420

                            Apart from that, please all ensure that you're working on the latest .NET including offering patches / SP's by Microsoft.
                            Let's take them one by one.

                            One of them is being sure the environment is up to date. This is just a "motherhood" item, It may or may not help, but it is surprisingly often the root of problems.
                            • NT should be up to date. Mine is ( 7.0.1000.2 ) Last I knew, it did not look as if yours is, so please update yours. I know of no downside to doing so.

                            • Microsoft patches should be up to date. Mine are, at least as far as Windows Update knows. (If there is some other .NET update, someone please enlighten me.) If yours is not, then please get caught up.

                            The other is the software. If you follow the link Bertrand provided, it will tell you to handle enums exactly as I have done, EXCEPT to not use the namespaces that I do. Please try his idea and let us know how it goes. (There is no point in my doing it, because I cannot show the build problem and so would not know whether anythig got fixed.) Here's what you need to do:
                            • In RwbHA, remove the namespace around the enum (lines 181 and 184) and the "using" statements (lines 177 and 178)

                            • In RwbLibrary, Move the namespace out from around the enums (move line 22 down to just before line 34 -- that gets the enums out and leaves the rest in) The "using" statements should be fine as is.

                            --EV

                            Comment


                              #59
                              Originally posted by ETFVoyageur View Post
                              OK -- at least we are on the same page now -- we appear to at least have the same sources. Good.
                              • NT should be up to date. Mine is ( 7.0.1000.2 ) Last I knew, it did not look as if yours is, so please update yours. I know of no downside to doing so.
                              Is there a link for this download ?
                              • Microsoft patches should be up to date. Mine are, at least as far as Windows Update knows. (If there is some other .NET update, someone please enlighten me.) If yours is not, then please get caught up.
                              I'm upto date, running .NET Framework 4 with all latest updates

                              The other is the software. If you follow the link Bertrand provided, it will tell you to handle enums exactly as I have done, EXCEPT to not use the namespaces that I do. Please try his idea and let us know how it goes. (There is no point in my doing it, because I cannot show the build problem and so would not know whether anythig got fixed.) Here's what you need to do:
                              • In RwbHA, remove the namespace around the enum (lines 181 and 184) and the "using" statements (lines 177 and 178)
                              Done, see attachment RmbHA to make sure I've followed instructions correctly and for the NT error.
                              • In RwbLibrary, Move the namespace out from around the enums (move line 22 down to just before line 34 -- that gets the enums out and leaves the rest in) The "using" statements should be fine as is.
                              Done, see attchment RwbLibrary for NT error.
                              Thx and hth.
                              Attached Files

                              Comment


                                #60
                                And this is line 212 in RwbLibrary and RwbHA to which the NT errors refer in attachments in previous post.
                                Attached Files

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by iceman2018, Today, 05:07 PM
                                0 responses
                                1 view
                                0 likes
                                Last Post iceman2018  
                                Started by rhyminkevin, Today, 04:58 PM
                                0 responses
                                21 views
                                0 likes
                                Last Post rhyminkevin  
                                Started by lightsun47, Today, 03:51 PM
                                0 responses
                                6 views
                                0 likes
                                Last Post lightsun47  
                                Started by 00nevest, Today, 02:27 PM
                                1 response
                                14 views
                                0 likes
                                Last Post 00nevest  
                                Started by futtrader, 04-21-2024, 01:50 AM
                                4 responses
                                49 views
                                0 likes
                                Last Post futtrader  
                                Working...
                                X