Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why am I getting a CS0101 error??

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

    Why am I getting a CS0101 error??

    What the heck? I am trying to create a new strategy. I use the strategy wizard, name the strategy, go to the next screen, then click Unlock Code. I immediately try to compile the new strategy and it's coming up with a bogus message:

    NinjaScript File Error Code Line Column
    Strategy\SwingBreakouts.cs The namespace 'NinjaTrader.Strategy' already contains a definition for 'SwingBreakouts' CS0101 - click for info 47 18

    What's up with that? I named the strategy DorkDoofouts. Here's the code:

    Code:
        [Description("Enter the description of your strategy here")]
        public class DorkDoofouts : Strategy
        {
            #region Variables
            // Wizard generated variables
            private int myInput0 = 1; // Default setting for MyInput0
            // User defined variables (add any user defined variables below)
            #endregion
    
            /// <summary>
            /// This method is used to configure the strategy and is called once before any strategy method is called.
            /// </summary>
            protected override void Initialize()
            {
                CalculateOnBarClose = true;
            }

    Why can't I compile this strategy? I closed and restarted NT and it still does this. Something is screwed up somewhere.

    #2
    cassb,

    It is an error in one of your other strategy files. Please address the strategy titled SwingBreakouts. Remember, to compile you need all your indicators and strategies to be error free.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      cassb,

      It is an error in one of your other strategy files. Please address the strategy titled SwingBreakouts. Remember, to compile you need all your indicators and strategies to be error free.
      Oh, so ALL those .cs files have to be error free to compile? No, I didn't realize that. So, what does the CS0101 tell me about what the problem is with the SwingBreakouts strategy? I don't understand what I need to fix.

      Edit: D'oh. Nevermind any more. I see what happened. If ALL of the .cs files get compiled into whatever DLL you're creating, then when I made a copy of SwingBreakouts and left it in the same folder... it's getting into the DLL twice. I guess if I want to back up a .cs file, I have to move it somewhere else. Is that what you recommend?
      Last edited by cassb; 09-18-2008, 12:23 PM.

      Comment


        #4
        You essentially have two strategies or maybe indicators sharing the same name as defined inside the strategy.

        Under this line: public class _____ : Strategy
        near the top probably. Just delete one or the other, or change the name of one and then try recompiling.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          >> ... then when I made a copy of SwingBreakouts and left it in the same folder... it's getting into the DLL twice. I guess if I want to back up a .cs file, I have to move it somewhere else. Is that what you recommend?
          You NEVER should manually copy/move/delete ANY file in your NT folders unless advised by our support team.

          For backup please see File->Utilities->Backup.

          Comment


            #6
            Originally posted by NinjaTrader_Dierk View Post
            >> ... then when I made a copy of SwingBreakouts and left it in the same folder... it's getting into the DLL twice. I guess if I want to back up a .cs file, I have to move it somewhere else. Is that what you recommend?
            You NEVER should manually copy/move/delete ANY file in your NT folders unless advised by our support team.

            For backup please see File->Utilities->Backup.
            Aw, but 'never' is such a permanent word, Dierk.

            It's a text file, so I made a copy of it while I was making some possibly disruptive changes. I wanted to be able to go back to the previous version easily. It's standard programmer type tactics. We don't need no stinkin' backup procedure. hehe

            Comment


              #7
              We have this policy in place to avoid unnecessary confusion and support cases related. Thanks for your understanding.

              Comment


                #8
                Originally posted by NinjaTrader_Dierk View Post
                We have this policy in place to avoid unnecessary confusion and support cases related. Thanks for your understanding.
                Oh yes, I understand. I work in the software industry myself. I would say the same thing to my customers.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                593 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                343 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                103 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                556 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                554 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X