Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compile error message with namespace

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

    Compile error message with namespace

    I'm getting the following error message: "The namespace 'NinjaTrader.Strategy' already contains a definition for 'xyz' " ,where xyz is the name of the strategy that I'm trying to compile. Any ideas on how to get rid of this compile error? I haven't changed the namespace line of the strategy.

    #2
    Have you created any other variable or DataSeries or something like that with the same name?
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I got it! I had renamed the xyz stategy and recreated another one. The original still had the xyz strategy name in the code. Thanks so much for the reply back and getting me to look at the right thing!

      Comment


        #4
        This is an older thread but it has the same problem as I am facing so I thought I should add to it.

        I am having the same problem as tradervick, getting the same message when trying to compile a strategy. I have created a new strategy with a new name but I am still getting the message. I have run search for the name in the new strategy document and it is not to be found. Like tradervick, I have not changed the namespace line of the strategy.
        The only thing I can think of to try is to empty the directory of all other strategies except the new one but I am reluctant to do that as I am running one of those other strategies on demo forward test.
        Any help would be appreciated.
        Thanks
        Karl

        Comment


          #5
          Karl, how did you create the new strategy? Was it a 'save as' of the old one or did you create completely new from the wizard? If you double click on the error > to which offending script would it take you then?

          Are you working perhaps with a public enum in the strategies that would now collide with a previously created one using the same name?

          Comment


            #6
            Bertrand, thanks for your reply. I did as I suggested in my post - I reluctantly deleted all strategies except the new one and the new one compiled without error. It means that there is an error in one of the other ones. I have copied and changed existing strategies to create new ones and I guess I will have to go back and look at each one - as soon as I have time. I will import each in turn and see which is the offender. Your suggestion to double click the error to see the offender is great, thanks - I shall do that. In the meantime, my new strategy is running and I have now found a new way to lose money!! Where is that Holy Grail - I'm sure I put it down somewhere but I cannot find it?

            Comment


              #7
              scartree,

              Great you got it working in the meantime.

              Always so elusive that Grail.
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              666 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              377 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              110 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              575 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              580 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X