Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Uncompilable NinjaScript

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

    Uncompilable NinjaScript

    Hi,

    I've installed a 3rd party custom strategy called ZBox

    It was able to run successfully for a while, then it would not enable any longer from the strategies window, for no apparent reason.

    It 'failed' on different Instruments at different times, first refusing to enable on YM on a live account only, then on NQ and YM on any account live or SIM, finally on any instrument at all.

    To resolve:
    I attempted to remove it using Tools/Remove NinjaScript Assembly, and received an error as per the screenshot
    I then on advise from the creator of the strategy removed it from the Documents/Bin/Custom folder
    I attempted to remove it again, and received an error again.
    I uninstalled and reinstalled NT8.

    However, I am no longer able to use the Strategy Builder, with an error message as per the next screenshot.

    I have two issues which need resolving:

    1) How do I remove all components and data when uninstalling/reinstalling NT8 so that I'm back to a 'clean' installation
    2) What needs to be done to resolve the issue with the custom script/strategy ZBox?

    Thanks.

    ****on


    Attached Files

    #2
    Try these steps: https://ninjatrader.com/support/help...jascript_p.htm
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Originally posted by TradingAssassin View Post
      2) What needs to be done to resolve the issue with the custom script/strategy ZBox?
      Have you asked the Zbox author for support?

      Once you get back to a clean installation, I would recommend
      you contact the author of Zbox.

      A quick google of 'ZBox NinjaTrader' and I found this page,
      Zoom in Algo System is the Premier Provider of Automated Trading Software for NinZa.co Indicators. Ninjatrader is a Leader in Futures Charting Platforms with Proven Autotrading Capabilities.


      Maybe you have a licensing issue.

      Good luck!



      Comment


        #4
        Hi,

        In respect of:

        2) What needs to be done to resolve the issue with the custom script/strategy ZBox?

        The Author recommended removing / reinstalling a new version of the script. I have done this, the issue did not resolve however.

        There does not appear to be a licensing issue.

        Cheers



        Comment


          #5
          If the key issue is that you are unable to "uninstall" ZBox because the Remove NinjaScript Assembly doesn't work, you could try to manually uninstall it. If you go this route, you need ot be very cautious because you might make the situation worse. Here's how I would do it if I couldn't compile and couldn't easily edit the NinjaScript back to a compilable state and it was a third-party assembly that was causing all my problems. Only undertake this if you feel comfortable doing it and understand this is not the supported way to do things so you're a bit "on your own" if you get this into the files. You'll need to know the name of the product in question. I can't give advice about every possible thing that could go wrong, so these instructions are just a general guide in the right direction to get you started if you want to try to do surgery on it so you don't have to reinstall.

          (1) Back up your Documents -> NinjaTrader 8 -> config.xml. Make sure NT Desktop is not running.
          (2) In File Explorer, go into Documents -> NinjaTrader 8 -> bin -> Custom and delete the bad DLL file and anything related to it. To be safe, if you're not sure what you're doing, just move them somewhere else, such as out to your desktop.
          (3) Restart NT8 and open Script Editor. Right click on the empty document area and choose References. Scroll down and delete the line(s) about the bad DLL and anything related to it.
          (4) Click Compile.

          That should get you closer to being able to compile.

          If you continue to have compilation problems you'll want to look at what files have the problems (this is shown in the orange lines at the bottom) and refer to the NinjaTrader instructions referenced above for how to isolate and remove the offending steps.

          Sometimes things get so messed up you're better off to rename your Documents -> NinjaTrader 8 to something like Documents -> NinjaTrader 8 Not Working and then just run a repair installation. You can then copy your most important things back into the new "NinjaTrader 8" folder such as your workspaces and templates and any custom NinjaScript. If you do this, you'll need to reconfigure your connections etc. when you sign in the first time. I've seen some cases where users accidentally did something like copy every NinjaScript Indicator to a different folder in bin -> Custom several times so there were bunches of copies of @SMA.cs etc. and this is pretty time consuming to fix so if you get too far gone you might want to follow this method of getting a repair installation going.

          The instructions above are certainly not all-encompassing - they're just intended to give you some ideas if you are comfortable making these sorts of changes to try to resolve an uncompilable state and depending on what is wrong they might not be enough or might compound your issue if you delete the wrong thing(s).
          Bruce DeVault
          QuantKey Trading Vendor Services
          NinjaTrader Ecosystem Vendor - QuantKey

          Comment


            #6
            Good advice, Bruce.

            For step 3, I usually just edit the Config.xml file with Notepad, find
            the <References> tag, then locate the filename for the bad DLL
            reference you just deleted in step 2, and delete the corresponding
            line. Save the file, then start NinjaTrader back up.

            If you do this trick by editing Config.xml, you don't have to open up
            NinjaScript Editor and right-click > References and delete it from
            that list -- the above editing trick has already removed it.

            I like this editing trick because it allows NT to startup cleanly, with
            no complaints about a reference assembly not found -- aka, the
            file you deleted in step 2.

            Do not change Config.xml while NinjaTrader is running.

            Of course, have a 'backup plan' for every step, so you can recover
            quickly if you mess up.

            Last edited by bltdavid; 05-07-2023, 10:59 AM.

            Comment


              #7
              bltdavid You raise a good point. I actually do it the way you described myself and typed up the instructions that way at first then I went back and changed it to edit the references using Script Editor because I thought that was less dangerous and I don't want anyone to mess up the whole thing accidentally. Still, the way you described it has the advantage of not giving that extra error message before they remove the reference. If they're comfortable changing Config.xml with Notepad, that's a perfectly valid approach and arguably better as long as they don't unintentionally edit any of the rest of the file by the Reference section line(s) in question.

              And yes, it bears repeating, MAKE BACKUPS before you do anything like this. Still, I'll bet I've done this dozens at least of times, and so far, knock on wood, it's always worked.
              Bruce DeVault
              QuantKey Trading Vendor Services
              NinjaTrader Ecosystem Vendor - QuantKey

              Comment


                #8
                Hello TradingAssassin,

                Thanks for your post.

                If the error(s) are being caused by the ZBox third-party add-on you mentioned, you would need to contact the developer of that indicator directly so they may look into what is causing the error in their add-on.

                Please follow the instructions below to see where the errors are coming from after compiling any indicator.

                For NinjaTrader 8:
                • Open NinjaTrader
                • From the Control Center select the New menu--> select NinjaScript Editor
                • Right-click in the window and select Compile to compile all NinjaScript objects
                • At the bottom of the NinjaScript Editor window, a new section will appear where you can find the error locations
                • You can exclude the file referenced in the editor by double-clicking on the appropriate object type on the right of the NinjaScript Editor window. This will expand the object type folder. You can then select the file with a left-click--> right click on the object--> then select Open to begin debugging the file, Exclude From Compilation, or Remove to delete the file.
                If you are unsure as to what the error is indicating, please send me a screenshot of the NinjaScript File column and Error column fully visible (not to be confused with the Code column)
                • To send a screenshot with Windows 7 or newer I would recommend using Windows Snipping Tool.
                • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot 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.
                We have also collected more comprehensive steps for resolving NinjaScript programming errors in this tip in our Help Guide:
                The steps QuantKey_Bruce shared could be taken to manually remove the addon from your platform. See the steps below.
                • Create a backup by going to Tools > Export > Backup file.
                • Close NinjaTrader.
                • Open a File Explorer window and navigate to the Documents\NinjaTrader 8\bin\Custom folder.
                • Delete the ZBox .dll and .cs files and any other files related to this add-on.
                • Restart NinjaTrader, open a New > NinjaScript Editor window, right click in the NinjaScript Editor window and choose References.
                • Remove the reference(s) to the ZBox dll and anything related to that add-on.
                • Run a compile in the NinjaScript Editor to check for errors.

                I see you mentioned creating a clean environment. Creating a clean environment can be done by following the steps below:
                1. Close NinjaTrader 8, and rename the "NinjaTrader 8" folder in My Documents to something like: "NinjaTrader 8 OLD"
                2. Uninstall NinjaTrader from the Windows Control Panel and reinstall using the installer from account.ninjatrader.com
                3. Add the required indicators and test the template.
                If you ever need to switch back to your original platform, you may do so by closing NinjaTrader and swapping the platform folder names.

                For example, Close NinjaTrader and rename the new "NinjaTrader 8" folder to "NinjaTrader 8 NEW" and the "NinjaTrader 8 OLD" folder to "NinjaTrader 8." Then restart the platform. Simply put: NinjaTrader 8 will always load the "NinjaTrader 8" folder in My Documents.

                Please let me know if I may assist further.​​
                Last edited by NinjaTrader_BrandonH; 05-07-2023, 03:52 PM.
                <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


                  #9
                  Many thanks Bruce/Brandon/bitdavid - I'll try those out and keep my fingers crossed!

                  Cheers.

                  Comment


                    #10
                    Oh, hey ...

                    [Brandon didn't mention it, but starting up in a 'clean' environment
                    made me think of this -- this trick could also be very helpful.]

                    Brandon, does NT still support a 'safe-mode' startup?

                    I think 'safe-mode' avoids loading any extra assemblies,
                    which could be useful to OP's situation, right?

                    Comment


                      #11
                      Hello bltdavid,

                      Yes, NinjaTrader could be started up in Safe Mode.

                      Safe Mode will prevent NinjaTrader from:
                      • Loading workspaces and connecting on start-up.
                      • Loading custom assemblies (i.e. 3rd-party add-ons and NinjaScripts)
                      • Getting instrument updates from the server
                      To enable Safe Mode, please use the following steps:
                      • Shut down NinjaTrader.
                      • Go to the Windows Start Button
                      • Search for NinjaTrader (Safe Mode)
                      • Launch NinjaTrader (Safe Mode)
                      Once you have opened the platform in Safe Mode:
                      • Reconnect to your Data Provider
                      • Open a new chart with no custom bar types/indicators/templates and test for issues.

                      <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

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by argusthome, 03-08-2026, 10:06 AM
                      0 responses
                      103 views
                      0 likes
                      Last Post argusthome  
                      Started by NabilKhattabi, 03-06-2026, 11:18 AM
                      0 responses
                      52 views
                      0 likes
                      Last Post NabilKhattabi  
                      Started by Deep42, 03-06-2026, 12:28 AM
                      0 responses
                      34 views
                      0 likes
                      Last Post Deep42
                      by Deep42
                       
                      Started by TheRealMorford, 03-05-2026, 06:15 PM
                      0 responses
                      37 views
                      0 likes
                      Last Post TheRealMorford  
                      Started by Mindset, 02-28-2026, 06:16 AM
                      0 responses
                      74 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Working...
                      X