Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The namespace `NinjaTrader.Strategy´ already contains...

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

    The namespace `NinjaTrader.Strategy´ already contains...

    Hi There

    I am just trying to compile my first NT7 script and am getting this error " The namespace ´Ninja Trader.Strategy´ already contains a definition for `Div1728Stop20Target50` "

    That is despite there being no reference to that strategy in my code below??

    Thanks for the help in advance.
    Attached Files

    #2
    Hello GKonheiser,
    You have used the OnBarUpdate twice.

    Line no. - 67 protected override void OnBarUpdate()

    Line no. - 82 protected override void OnBarUpdate()

    You can only use it once. Please rectify it and try to recompile your code.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi JoyDeep

      Thanks for the help. Have corrected that but still have the same Error as before?

      Comment


        #4
        Also where it lists the NT Script errors it refers to the file Div1728Stop20Tarrget50.cs when I have saved this strategy as DIVEMA, (See attachment)?
        Attached Files

        Comment


          #5
          Hello GKonheiser,
          The error is coming from another NinjaScript code namely Div1728Stop20Tarrget50.cs

          You have to rectify or remove that NinjaScript code to compile it successfully.
          JoydeepNinjaTrader Customer Service

          Comment


            #6
            I am getting an error when I try and delete any strategy. Driving me nuts!

            Comment


              #7
              Hello GKonheiser,
              Are you using any third party NinjaScript code?

              Can you upload a screenshot of the error you are receiving.

              To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

              For detailed instructions please visit the following link

              How to take a screenshot on your smartphone, tablet, notebook or desktop computer
              JoydeepNinjaTrader Customer Service

              Comment


                #8
                No 3rd party code. just stuff that I and a college and written. Here is the screen shot.
                Attached Files

                Comment


                  #9
                  Hello GKonheiser,
                  The Div1728Stop20Tarrget50.cs file is referenced to other NinjaScript files. Unless you remove all dependency NinjaScript files, you cannot delete it.

                  If you are not sure how to rectify it, please send your contact number to support[AT]ninjatrader[DOT]com

                  Please append Attn:Joydeep in the subject line of your email and give a reference of this thread in the body of the email.

                  I look forward to assisting you further.
                  JoydeepNinjaTrader Customer Service

                  Comment


                    #10
                    Have sent number.

                    : )

                    Comment


                      #11
                      Top rate fast support. Thank you very much JoyDeep. ; )

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      581 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      338 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
                      554 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      552 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X