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

The namespace already contains a definition

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

    The namespace already contains a definition

    I'm developing strategies for some time now. Yesterday I opened NinjaTrader 8, made one minor change in a strategy, then compile and export it. After that I closed my system.
    Today I opened NinjaTrader 8, made another minor change (nothing code breaking) and tried to compile strategy. I've got errors:
    "The namespace 'NinjaTrader.NinjaScript.Indicators' already contains a definition for 'EMA'".
    Same error I've got for other Indicators, that are used in my strategies.
    There are also errors:
    "The namespace 'NinjaTrader.NinjaScript.Strategies' already contains a definition for 'StrategyX".
    Not all my strategies are mentioned in error log.
    I've reverted my changes in strategies, but nothing helped. I can't complile strategies. I didn't ever made any changes to System Indicators.
    Do you know, what is causing the error? I'm using NinjaTrader 8.0.10.0 64-bit.
    Regards
    Attached Files
    Last edited by InteRadek; 12-01-2017, 05:34 AM.

    #2
    Hello InteRadek,

    Thank you for your post.

    Please check the following items and advise if you have duplicate files listed.
    • Expand the indicators folder on the right side of the NinjaScript Editor and check if you have duplicate files listed.
    • Go to the Documents\NinjaTrader 8\bin\Custom\Indicators folder and check if duplicate files are listed.

    I suspect there will not be duplicates listed and if there is not I would recommend repairing your installation and then compiling.

    Please follow the steps listed below to completely uninstall and reinstall NinjaTrader.
    • Close all running applications.
    • Uninstall NinjaTrader within Windows Control Panel.
    • Reboot your machine.
    • Once these steps are completed, download and install NT8 from the link below.
    • http://ninjatrader.com/PlatformDirect

    Once complete please compile your files in the NinjaScript Editor and advise if the errors are still present.

    I look forward to your response.

    Comment


      #3
      Hi Patrick,
      Thank you for your support. I found duplicated Indicators. In ExportNinjaScript folder I unzipped one copy of source code of a strategy to compare it using Diff. It contained Indicators, that were used in this strategy. I wasn't aware, that this folder will be included by a compiler, because it isn't visible in NinjaScript Explorer. It's a little inconsistency in compiler's behavior.
      Last edited by InteRadek; 12-04-2017, 01:26 PM.

      Comment


        #4
        Thanks for posting the source of your problem. As soon as I saw it I knew it was the answer to mine as I did the same thing.

        Comment


          #5
          I would expect the problem to be resolved after 3 years, but apparently no one has marked it as an application bug which it actually is.

          Comment


            #6
            Hello InteRadek,

            When using supported steps to import scripts and without modifying the filesystem, this type of error is not possible. NinjaTrader when first installed will point to the correct location of the settings folder. When new scripts are being imported NinjaTrader will prevent any script from importing that will cause errors.

            Modifying the filesystem (such as copying scripts or moving scripts) or improperly importing scripts, or allowing 3rd party software to do this will cause these errors.

            If you are able to reproduce this behavior with a clean environment without any 3rd party scripts we would be very interested in reporting this.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by InteRadek View Post
              I would expect the problem to be resolved after 3 years, but apparently no one has marked it as an application bug which it actually is.
              Nope, it's not a problem with the product.

              The problem is the product user is fiddling with things inappropriately or incompletely.

              Now, generally speaking, fiddling is not a bad thing, since fiddling under the hood with
              NinjaTrader is why lots of users fell in love with NinjaTrader.

              However, fiddling means you should know what you're doing, and if you do something
              that creates an error, you especially have to know how to undo what you did.

              When fiddling is really just 'experimenting' (which is where every newbie starts, including me)
              well, that 'knowing how to undo' part becomes even more critical.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              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
              1 view
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              6 views
              0 likes
              Last Post Javierw.ok  
              Started by timmbbo, Today, 08:59 AM
              2 responses
              10 views
              0 likes
              Last Post bltdavid  
              Started by alifarahani, Today, 09:40 AM
              6 responses
              41 views
              0 likes
              Last Post alifarahani  
              Working...
              X