Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Recompilation needed after each NT-Restart

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

    Recompilation needed after each NT-Restart

    Hello,
    in my NT 8.0.28 installation I experience the following issue with 3 custom scripts I recently generated:
    1. After each restart of NT these custom scripts are missing in all charts of my workspace although all scripts have been successfully compiled before without any error. Also it is not possible to re-insert them in the charts because they are not visible anymore in the indicator window. In NinjaScript Editor they are still visible.
    2. The only way I found to get them working again in the charts is to re-compile NT before opening that workspace. After doing so the workspace then loads successfully with all the scripts. After each restart of NT I have to do so which is quite annoying.
    3. Using NT SafeMode does not change anything: It is still necessary to re-compile after each restart in order to get the scripts working.

    Could you please help me in order to find and hopefully solve this issue?

    Many thanks

    #2
    Hello Joerg,

    Thanks for your post.

    When this behavior occurs do you receive an error on screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?

    Are these custom NinjaScripts created by you? Or, are these NinjaScripts created by a third-party developer?

    Before closing NinjaTrader, are you saving the Workspace by going to Control Center > Workspaces > hovering mouse over the workspace > and clicking 'save' while the chart is open and the indicators are applied to the chart?

    We look forward to assisting further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      The scripts have been created by myself and since I know this issue I do not re-save the workspace without the working scripts. I saved it with working scripts (after my described workaround) and avoid to overwrite it since then.

      There is no pop-up window but there is a log entry for each indicator in each chart saying e.g.:

      2024-03-26 20:34:41:176|3|16|Failed to restore Indicator 'NinjaTrader.NinjaScript.Indicators.MyHLineAtTime' . Most likely (a) the implementation changed or (b) one or more properties have been renamed or removed or (c) the custom assembly which implements this Indicator no longer is there.
      Maybe it is connected to a rename I have done recently? I used right click in the ScriptEditor and it seemed to work properly.
      Last edited by Joerg; 03-26-2024, 01:46 PM.

      Comment


        #4
        Hello Joerg,

        Thanks for your notes.

        This error is seen when a workspace loads an indicator that is no longer included in the system or changes have been made to the script after it was added to the chart.

        To resolve this error message, you would need to remove the indicator from the Chart window and save the workspace with the indicator removed.

        Then, run a compile in the NinjaScript Editor to check for errors, add the indicators back to the chart window, and save the workspace by going to Control Center > Workspaces > hovering the mouse over the workspace > and selecting 'save'.

        Note the log tab of the Control Center for any errors that may appear when saving the workspace with the chart open and the indicators added to the chart.

        Below is a forum thread that discusses this error which you might find helpful.

        Hi, I have a simple indicator that plots a graph on the chart - however, every time I restart ninja or duplicate the tab into new tab, the indicator is disappearing and doesn't exist in the new tab. I tried to debug and see if there are any errors, but couldn't get any - the indicator is never loaded on the new tab (unlike

        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Hi Brendon,
          thank you for the quick response. I have tried as described but still observed the same issue. Also I tried to repair the installation and finally reinstalled Ninja which solved the problem. Unfortunately I now cannot isolate the source of the issue but it works as expected.
          Best regards
          Joerg

          Comment


            #6
            Hello,
            during the last months I not worked on new scripts or imported any new custom codes but as I did some days ago the problem occurs again: NT does not re-compile during the startup of the program. As soon as I re-compile manually everything works fine.

            The script I am using comes from NT-ecosystem: https://ninjatraderecosystem.com/use...-ict-v0-0-3-0/

            After some testing I can summarise as follows:
            1. It is not caused by the script because a manual recompilation works.
            2. It seems also not a problem with the workspace: I tried with a completely empty workspace and the new script is not compiled during startup as well.
            3. NT-SafeMode does not change anything despite the fact that a manual recompilation seems not to be possible there.
            4. The problem does not occur after the first start after a re-installation using the existing Documents/NinjaTrader8 folder including the mentioned script. With the second re-start after a re-installation the problem is back.
            To me it seems that during a re-installation of NT some kind of mapping / inventory of existing scripts is produced and used for the first start of NT which then gets lost for the second re-start?!

            Many thanks in advance for any help.

            Comment


              #7
              Hello Joerg,

              To eliminate other possible causes of the behavior please take the following steps to test.
              1. Create a new clean NinjaTrader environment folder
                1. Shutdown NinjaTrader
                2. Rename (My) Documents\NinjaTrader 8\ to (My) Documents\NinjaTrader 8.original\
                3. Download the NinjaTrader installation package from the link below
                4. NinjaTrader - Download
                5. Run the repair from this (if the repair is unsuccessful, uninstall and then re-install NinjaTrader)
              2. Create a new blank test indicator with a unique name and compile it
              3. Restart NinjaTrader twice
              4. Check to see if the indicator is listed in the Available list of the Indicators window.
              Let me know if the behavior can still be reproduced in the clean environment folder with a new test indicator.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Hello Chelsea,

                thank you for your reply.
                1. I tried as described and yes, with a fresh environment folder NT compiles new custom indicators during re-start as expected, even after several restarts.
                2. When I then switch to my former custom folder it does not work anymore.
                3. Interestingly, when I then switch back again to the "clean" folder including the new custom indicator it works again.
                So, something in my custom folder seems to be the problem but how can I figure out what exactly?

                Many thanks!
                Last edited by Joerg; 10-20-2024, 11:50 AM.

                Comment


                  #9
                  Hello Joerg,

                  Use the new generated Custom folder, and copy over each open source script one at a time.
                  After copying an open source script, compile and test for the behavior.

                  Any file with the @ symbol preceding the filename is a system indicator and does not need to be copied over.
                  Any file with the @@ symbol preceding the filename is excluded from compilation and you may want to copy over.

                  The open source files will be with the subfolders: Addon, Indicator, Strategy, etc.

                  For now, don't copy any assembly dll files (or accompanied .cs helper files).

                  Let me know if the behavior returns when copying over a specific file.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Hi Chelsea,
                    I now have copied all custom .cs files and it still works... manual recompiling is not necessary again.
                    Shall I now try the scripts which are using a .dll, i.e. external custom indicators from other vendors?

                    Thanks a lot.

                    Comment


                      #11
                      Hello Joerg,

                      Yes, test the assemblies one at a time as well.

                      After moving an assembly dll and it's .cs helper file, it is necessary to add a reference to the dll file.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Hello Chelsea,

                        for the 3rd party indicators I now also tested and the error with the necessary recompilation does not occur again.
                        But if I generate a new own indicator (without any logic included, just the empty NT-template) then it is necessary to recompile after each restart again?
                        So, the problem occurs only after the generation of a new indicator within this installation but not with copied scripts.

                        Comment


                          #13
                          Hello Joerg,

                          Just to confirm, you were following my direction in post # 7 and creating a new indicator with a unique name and you were not able to reproduce, is this correct?

                          After copying the assemblies, the behavior returned, is this correct?
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Hi Chelsea,

                            let me summarise what I did in order:
                            1. I followed your instructions in post#7, i.e. I created a clean NT-installation which then worked without non-compiled scripts (i.e. a new custom indicator did not cause the need for recompilation after NT-restart)
                            2. I copied my own existing custom indicators into that installation and later also included my 3rd party studies incl. DDL and references into that installation, which still worked without non-compiled scripts after re-start
                            3. If I now create a new custom indicator (the standard MyCustomIndicator template) via ScriptEditor it initially compiles, but I now get back the discussed error, i.e. I have to recompile manually after each NT-restart

                            Comment


                              #15
                              Hello Joerg,

                              From the description it sounds like the behavior returned after copying over the assemblies.

                              Please take the following steps to confirm:
                              1. Remove all assemblies
                              2. Restart NinjaTrader
                              3. Create a new blank test indicator with a unique name and compile it
                              4. Restart NinjaTrader twice
                              5. Check to see if the indicator is listed in the Available list of the Indicators window.
                              ​To remove a third party assembly package:
                              Chelsea B.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              61 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              40 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              21 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              23 views
                              0 likes
                              Last Post TheRealMorford  
                              Started by Mindset, 02-28-2026, 06:16 AM
                              0 responses
                              51 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Working...
                              X