Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Deleting a script

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

    Deleting a script

    Sorry if I didn't post this in the correct forum.

    When I went to delete a custom indicator I made, I had a pop-up message saying............********.cs can not be deleted. This file is likely referenced by other NinjaScript files and these dependncies need to be removed first.

    I searched the forums with *delete script* criteria. I found this
    http://www.ninjatrader-support2.com/...ead.php?t=4678
    Number 10 says in part *...open the file that references the file you wish to delete....*.
    I also found this in the forum *You have to remove the reference from the strategy where you are calling this indicator.*

    Please point me in the direction of how to find the script that is doing the referencing. I may have created a custom indicator with the strategy wizard. Could this be the problem child? Do indicators and strategies reference?

    Thank you.

    #2
    jethro, you would need to step through your codes created to find the script referencing the custom indicator you with to delete, then either delete the calling script first or just comment out the section calling the custom indicator you wish to delete. Then you should be good to delete it.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for your reply but I'm a little dense right now. What do you mean by *step through your codes *? Look at each line of my code? What would I look for in each line for this referencing?

      Thanks

      Comment


        #4
        You will need to review your scripts and strategies setup in the wizard for example, when you work with this indicator you're trying to delete (for example work with his returned value in a strategy) you will see issues when you attempt to delete it.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Can't delete script from Edit list

          Can't remove scripts, that I no longer need from Tools-Edit NT Script - Strategy - try to Delete - there is message
          Click image for larger version

Name:	1.PNG
Views:	1
Size:	16.0 KB
ID:	865099
          In others scripts after trying to Compile - there is same error for all
          Click image for larger version

Name:	2.PNG
Views:	1
Size:	9.0 KB
ID:	865100

          Comment


            #6
            Originally posted by jethro View Post
            Thanks for your reply but I'm a little dense right now. What do you mean by *step through your codes *? Look at each line of my code? What would I look for in each line for this referencing?

            Thanks
            The line(s) you're looking for would be something like this, probably in Initialize():

            'Add(nameOfProblemIndicator);'

            Basically, if you use this indicator in any of your strategies, you need to remove the line above before you can delete the indicator source file.

            Comment


              #7
              Originally posted by alexstox View Post
              Can't remove scripts, that I no longer need from Tools-Edit NT Script - Strategy - try to Delete - there is message
              [ATTACH]21610[/ATTACH]
              In others scripts after trying to Compile - there is same error for all
              [ATTACH]21611[/ATTACH]
              alex, I would suggest to try removing the tutorial1.cs strategy manually from the Documents\NinjaTrader 7\bin\Custom\Strategy folder and then recompiling your scripts in the NT editor. Would you be able to compile normally then?
              BertrandNinjaTrader Customer Service

              Comment


                #8
                I've removed it manually. But still have errors.

                I noticed some dependence/succession. I started to lern NT Script and create first script called "Tutorial1". But than just start to write own script there. I rename it as someone suggested at forum - /right mouse - save as - "MyS1"/. After trying to compile it, there were errors with "Tutorial1.cs" as I wrote in previous post. Then I create new script /Tools-NewScript-Strategy-MyS2/, add some conditions. BUT after trying to compile it - there were errors with "Tutorial1.cs" too! What all this mean? Am I doing something wrong? ://
                I delete "Tutorial1.cs" manually. Now in "MyS2" there are errors with "MyS1.cs". Strange dependence, because "MyS2" was created by /Tools...../ without any reference to "MyS1".
                Last edited by alexstox; 04-13-2012, 02:07 PM.

                Comment


                  #9
                  UP. Please Help! There are similar cases. When copy strategy from code "save as...". And compile this new script - it will has errors from previous script from which were copied.
                  And no names of previous strategy in new strategy code.

                  Comment


                    #10
                    Alex, NinjaTrader will always compile all your scripts, as they all would be added to one assembly file to be used at runtime to realize optimal performance - hence it's not uncommon to see compile error from another installed script when compiling an unrelated script.

                    Please delete the erroneous scripts or comment out the code causing the compile issues, a double click on the error shown in the editor would directly lead you to the error line / section in your custom code.

                    We've compiled a series of steps to resolve compile issues here in this tip -

                    http://www.ninjatrader.com/support/f...ead.php?t=4678
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Thanks. Everything fine, because as you wrote - NT compiles all scripts.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by antcoster, Today, 11:26 AM
                      0 responses
                      0 views
                      0 likes
                      Last Post antcoster  
                      Started by WalterSkinner, 02-07-2022, 09:22 AM
                      23 responses
                      121 views
                      0 likes
                      Last Post Lance El Camino  
                      Started by cryfgg, Today, 11:15 AM
                      1 response
                      6 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Started by trdninstyle, Yesterday, 09:32 AM
                      27 responses
                      168 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by sambathraj, 09-26-2022, 07:28 PM
                      2 responses
                      56 views
                      0 likes
                      Last Post sambathraj  
                      Working...
                      X