Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error message

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

    Error message

    I have tried to edit a strategy named "BestES2Try". After making the changes I click on "finish" to save it but i get an error message "NinjaTrader.Strategy" already contains a definition for 'BestAnything...'. This is actaully the name of a different file. Is there anyway I can salvage the "BestES2Try" file.

    The error is supposed to be on the line 22 (which is the Public class line.

    // This namespace holds all strategies and is required. Do not change it.
    namespace NinjaTrader.Strategy
    {
    ///<summary>
    /// ES, Stochastics Cross above, Stochastics D below 20, No Volume, Buy/Sell .
    ///</summary>
    [Description("ES, Stochastics Cross above, Stochastics D below 20, No Volume, Buy/Sell .")]
    publicclass BestES2Try : Strategy
    {

    Thanks.

    #2
    Another problem has popped up. I tried to import something. I get a message "you have errors in your Ninja Script file. Fix those before you can import".

    Comment


      #3
      Hi ju1234,

      Please change the code snippet you posted from 'publicclass' to

      Code:
      public class
      For the other compiling errors you spotted, please debug everyone of them (also in your other files, easy since all errors are listed in the lower portion of your NinjaScript editor). Double click on each error to see where it occured, fix the code and hit F5 to compile again.

      For additional instructions, please review this link - http://www.ninjatrader-support2.com/...ead.php?t=4678

      Comment


        #4
        Josh, once I manually edit the "Publiclass" I will no longer be able to use the Condition builder for going back into this strategy. I use this as a base to try changes to it. So, is there any way to fix it through the condition builder?

        Comment


          #5
          Hi ju1234,

          Please delete then the 'BestAnything' file manually and see if you are able move on with the other file in the Wizard.

          Thanks!

          Comment


            #6
            Is there a way i can copy everything from "Bestanything" file before i delete it or can i just rename this file, will that fix it.

            Comment


              #7
              Hi ju1234,

              Please rename the file then first to save your modifications and delete 'BestAnything' then afterwards.

              Comment

              Latest Posts

              Collapse

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