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

Indicator already exists in Namespace

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

    Indicator already exists in Namespace

    Hi,

    when trying to compile my indicator I am getting the error "the namespace ninjatrader.indicator already contains a definition for myindicator".

    I removed the source file from the indicator folder, there are no references to myindicator in the ninjatrader.custom.dll or .xml.

    However when I start NT I can add myindicator to my charts.

    How can I remove this indicator, so that I can then recompile it?

    Thanks,
    Will.

    #2
    Will, if even sources are removed the indicator would still be available in compiled form in the custom assembly until you recompiled a more current version that would then not include the removed sources cs.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Ok,

      so How can I recompile to remove that error?

      And when you say custom assembly, do you mean ninjatrader.custom.dll? If so, I reverted to a previous version of that file that did not include myindicator, but the error was still occuring.

      Thanks,

      Comment


        #4
        Right, you would need to remove the source manually and then recompile all your scripts. What we would not suggest is manually copying / replacing the custom dll though, that is something only the NT compiler should update / generate.

        Would you mind sending me a screenshot of the exact error to support? Perhaps the script was accidentially copied as well to another folder which would be included in the custom dll compile, like the strategy or type ones?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          when you say remove the source manually, you mean remove the source from the ...\custom\indicator folder? if so, then I have already done that.

          Comment


            #6
            Originally posted by dontpanic View Post
            when you say remove the source manually, you mean remove the source from the ...\custom\indicator folder? if so, then I have already done that.
            That is correct.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              so, then what else do I have to do if that doesnt work?

              in what assembly does my indicator exist? I could replace that assembly with a previous version.

              Comment


                #8
                I would try this - close down NT, and remove the NinjaTrader.Custom dll and then also ensure your indicator is not present if any of the NT folders used for the custom dll creation (indicator, strategy, type). Then restart and recompile the dll.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  we seem to be going around in circles here a bit, however...

                  I removed the source file, deleted ninjatrader.custom.dll

                  I restarted NT, chose one of the standard NT indicators and recompiled it. When I open a chart, and add an indicator to it, myindicator is already in the list of indicators that I can add to the chart, even those the source is gone, and deleted the custom.dll.

                  does Myindicator exist in some other assembly?

                  Comment


                    #10
                    'does Myindicator exist in some other assembly?' Something I could not answer as I would not know if you have it present in a custom assembly or if the source would perhaps be sitting in one other folder as I had previously indicated, that's something you would need to check on your setup.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      the source does not exist in any other folder.

                      not sure what happened this time that was different, but this time it compiled.

                      does it compile source files that are in the \custom folder (not the \custom\indicator folder)? There was a copy of myindicator.cs in that folder, but I thought it would only be compiling sources in the child folders?

                      Comment


                        #12
                        Yes, glad to hear that. Correct, the Indicator / Strategy / Type folders would be ALL compiled to the single custom dll.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          thats my point. it wasnt in ANY of the folders you mentioned, it was only the in the parent folder (\custom).

                          Comment


                            #14
                            I see thanks, yes this top folder would count in as well, as that's where the default custom references would go.
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              ok, thanks.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by bortz, 11-06-2023, 08:04 AM
                              47 responses
                              1,603 views
                              0 likes
                              Last Post aligator  
                              Started by jaybedreamin, Today, 05:56 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post jaybedreamin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              18 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              12 views
                              0 likes
                              Last Post Javierw.ok  
                              Working...
                              X