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

Why does a single programming error in one NS screw up every other NS?

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

    Why does a single programming error in one NS screw up every other NS?

    I find it frustrating that if any NinjaScript file has a programming error, it prevents compiling, opening, importing, editing etc. of other unrelated indicators.Worse yet, NinjaTrader doesn't even tell you which indicator is causing the problem.

    Example 1
    I've been editing a NS that references an indicator which wasn't there. So I try to import it

    NT: "ERROR, You can't do anything because one of your scripts has a programming error."

    Me: "But I need to import this script so the other one will compile!"

    NT: "Tough luck!"
    Example 2
    I'm working on a strategy and have an error. There's nothing in the help. Maybe if I import this example script it will help me figure it out.

    NT: "ERROR, You can't do anything because one of your scripts has a programming error."

    Me: "But I need to import this script so I can troubleshoot my problem"

    NT: "Sorry, learn how to program and maybe I'll let you import again"

    Me: "What do I do?"

    NT: "Delete your script, HAHAHA"


    Aside from using Visual C# as a development environment, is there a way around this?

    #2
    There is no way around it. Using VS would not make any difference.

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      There is no way around it. Using VS would not make any difference.
      Yes, I see you're right. Is this a NinjaTrader 'thing', or a C# 'thing'?

      Is it because all NinjaScripts are considered part of NinjaTrader.Custom.csproj, and projects can't have any erroneous components?

      What if I copy the .cs file to a different location to work on it, then overwrite the original once its functional?

      Comment


        #4
        >> Is it because all NinjaScripts are considered part of NinjaTrader.Custom.csproj
        Correct, that's how it is designed. There is no way around.

        Comment


          #5
          Thanks for your help.

          Comment


            #6
            Elliott Wave,

            Are you running version 6.5 yet? I found that a lot of the problems I had with this issue have been resolved to some extent. It still wants to have every strategy compile, but it is much better about separating the problems and identifying where the errors occur.

            Comment


              #7
              Yep, I'm using 6.5.

              Luckily if I have a script open and try to compile it will tell me which file contains the error so I can fix or delete it. When trying to import a scrip though, it doesn't tell you.

              I can understand the problem, its just frustrating, especially when you're like me and tend to have many errors.

              Comment


                #8
                Hello,

                How do I delete an indicator?

                I have had an indicator and what I am doing is not working so I want to start again with a fresh new approach. But due to the peculiarity of NT mentioned in this thread (ie. having to correct all errors in existing files before being able to start compiling a new file) I can't start a new file (new indicator) and the old one is too difficult/impossible to fix. Besides, the system has (through the act of compiling???) added its own code beneath my code (which I don't know what it does) and it says not to remove it. Worse, it references variables declared in my code so if I comment-out all of my code it then complains that such-and-such variable is not declared.

                There must be a way of junking whole indicator, surely?

                MarkBN

                Comment


                  #9
                  Tools->Edit NinjaScript->Indicator->Select->Delete

                  Comment


                    #10
                    If unsure which one is the problem, you can always open any indicator in the script editor and try to compile it, that will tell you which one has the problem.

                    If you don't want to lose your work, you can always move the indicator into a different folder and edit it in Visual C# Express (free) until you feel it should work properly, then copy it back into the proper dir, open it in the NS editor and compile it from there...

                    Comment


                      #11
                      We strongly recommend to NEVER manually move NS files, since this easily could screw up your installation.

                      If you want to "deactivate" files for compilation:
                      - pull it up in the editor
                      - select all: CTRL A
                      - comment all: CTRL K and CTRL C
                      - press F5 to compile
                      - to reactivate later: CTRL K and CTRL U

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by helpwanted, Today, 03:06 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post helpwanted  
                      Started by Brevo, Today, 01:45 AM
                      0 responses
                      6 views
                      0 likes
                      Last Post Brevo
                      by Brevo
                       
                      Started by aussugardefender, Today, 01:07 AM
                      0 responses
                      5 views
                      0 likes
                      Last Post aussugardefender  
                      Started by pvincent, 06-23-2022, 12:53 PM
                      14 responses
                      242 views
                      0 likes
                      Last Post Nyman
                      by Nyman
                       
                      Started by TraderG23, 12-08-2023, 07:56 AM
                      9 responses
                      384 views
                      1 like
                      Last Post Gavini
                      by Gavini
                       
                      Working...
                      X