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

    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 -

                    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 kevinenergy, 02-17-2023, 12:42 PM
                      117 responses
                      2,764 views
                      1 like
                      Last Post jculp
                      by jculp
                       
                      Started by Mongo, Today, 11:05 AM
                      5 responses
                      15 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by SightCareAubetter, Today, 12:55 PM
                      0 responses
                      3 views
                      0 likes
                      Last Post SightCareAubetter  
                      Started by traderqz, Today, 12:06 AM
                      8 responses
                      16 views
                      0 likes
                      Last Post traderqz  
                      Started by SightCareAubetter, Today, 12:50 PM
                      0 responses
                      2 views
                      0 likes
                      Last Post SightCareAubetter  
                      Working...
                      X