Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader is broken on installation.

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

    NinjaTrader is broken on installation.

    I spent the weekend trying to write a new strategy. I am not a good coder, so was unsurprised when it did not work. I asked GPT-4o to debug the code for me. It did, but the strategy still could not be compiled. After many iterations, it concluded that something in my computer's environment was causing NinjaTrader to be installed incorrectly.

    As a test, it had me delete the Custom > bin and obj folders. NinjaTrader did not recreate them after being closed and restarted. It also did not create them after updating the program from Version 8.1.3.1 to Version 8.1.41. I used RevoUninstaller to uninstall NinjaTrader 8.1.3.1 and eliminate the many remaining files and registry entries before installing the new version.

    In addition, the Log tab no longer appears in the Control Center panel.

    At one point, the AI instructed me to navigate to \Custom\References\ to confirm that the necessary DLLs were present. The References folder itself was missing. This occurred after upgrading to Version 8.1.4.1.

    As a test, GPT-4.0 had me try to compile the following routine, and several variations of it, in both versions of NinjaTrader:

    region Using declarations
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Gui.Tools; // Required for Draw.TextFixed
    #endregion

    namespace NinjaTrader.NinjaScript.Strategies
    {
    public class TestStrategyType : Strategy
    {
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Name = "TestStrategyType";
    }
    else if (State == State.Configure)
    {
    // Display the base class type on the chart
    Draw.TextFixed(this, "BaseClassType", $"Base class type: {this.GetType().BaseType.FullName}", TextPosition.TopLeft);
    }
    }
    }
    }​

    Compilation failed and brought the following error codes:

    At line 18, column 17: "The name 'Draw' does not exist in the current context.
    At line 18, column 111: "The name 'TextPosition' does not exist in the current context.​

    There is more, but enough. Please help me find out what is going wrong, and tell me how to correct it. I imagine a first step will be to tell me how to find the log files and send them to you in the absence of the Log tab.

    Deep thanks for whatever help you can provide.

    #2
    Hello owen5819,

    I would highly suggest avoiding using AI based tools for NinjaScript as they do not do well at generating code that compiles. In that use case it would be expected that you complete the code to make it compile by using your existing development skills to understand the errors and correct them. We recommend using the platforms built in tools for generating new scripts and then the help guide and api guides to learn NinjaScript. I have included some learning resources below along with the API guide.

    To make new NinjaScript files I would always suggest to use either the NinjaScript editor or strategy builder. After a file is generated it has default code that is required to be present in the file. Your custom code would be added into the relevant overrides while maintaining that default structure so the script can compile and work properly. If you copy the entire generated code from AI into your file and replace that structure it is more than likely going to have errors.


    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


    AI Disclaimer
    From our experience at this time, ChatGpt and other AI models are not adequate at generating valid NinjaScript code that function as the user has intentioned. We often find that these tools generate code that will call non-existent properties and methods, use improper classes or inheritance, and may have incorrect logic. Using these tools for general NinjaScript learning information may also provide incorrect responses. We highly encourage that you create a new NinjaScript yourself using the NinjaScript Editor and avoid any AI based coding tools.

    While it would not be within our support model to assist with scripts generated or checked by ai tools, we would be happy to provide insight for any direct specific inquiries you may have if you would like to create this script yourself. Our support is able to assist with finding resources in our help guide as well as simple examples, and we are happy to provide guidance on how you can debug the script while running it on your machine. To start learning NinjaScript I would suggest the following link as a starting point.


    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.​
    JesseNinjaTrader Customer Service

    Comment


      #3
      My intent was not to get GPT-4o to do my work for me. I understand that not even the best AI currently available is capable of generating reliable code for NinjaTrader. Identifying my own mistakes seemed a better hope. However, that part of my message was intended primarily as background explaining how the real issues were discovered. My real issues are these:

      Neither version 8.1.3.1 nor version 8.1.4.1 displays the Log tab on the Control Panel.

      Version 8.1.3.1 does not recreate \Custom\bin\ and \Custom\obj\ once those folders have been removed. Version 8.1.4.1 does not create them at all.

      Version 8.1.4.1 does not create \Custom\References\.

      Are these behaviors normal, or do they indicate a problem with my system?

      If these all are normal, how do I locate the logs now that the Log Tab has been replaced?

      Thank you for your help.

      Comment


        #4
        Hello owen5819,

        If you have manually modified the user folder I would suggest doing a clean install and rename the user folder so it gets regenerated. We do not suggest to manually modify the folders or files in the custom folder unless specifically directed to by support.

        To open the log tab you can left click on the plus sign in the tab strip and click Log to re open it if you have closed it.

        Use the following steps to do a clean user folder test.
        1. Exit NinjaTrader
        2. Open the Documents folder
        3. Rename the NinjaTrader 8 folder to NinjaTrader 8 Old
        4. Download the installer from https://account.ninjatrader.com/download
        5. Install the platform, this will create a new user folder.
        6. Open the platform and import any of the items that you need
        JesseNinjaTrader Customer Service

        Comment


          #5
          I do not remember having ever touched the user folder, but I will try reinstalling NT8 again. Note that this will be my third installation of 8.1.4.1 in two days. Maybe the fourth; I seem to have lost track. Whatever. Many thanks for your help.

          Comment


            #6
            I have renamed the old NinjaTrader 8 folder and reinstalled 8.1.4.1 after using RevoUninstaller to remove the last traces of NT8 from the registry and files. NT8 still has not created \Custom\bin\ or \Custom\obj\. \Custom\References\ also has not appeared. Google's AI tells me that isn't really a folder but part of the NinjaScript Editor. Would not be the first time I had made a mistake (you may have noticed), but I see no evidence of it there, either. Heading for the Help files now. Any thoughts would be very welcome.

            Comment


              #7
              Hello owen5819,

              The platform will create files and folders based on actions. Are you seeing some sort of problem in the platform?

              Again we can't suggest using AI for help because it provides incorrect info at this time so I am not sure what the AI told you but it likely is not relevant.
              JesseNinjaTrader Customer Service

              Comment


                #8
                No problems so far, but all I am doing so far is recreating charts and workspaces. If anything does come up, you will be the second to know--unless I have learned what to do about it myself by then. Thanks for your help..

                Comment


                  #9
                  Oh, and no, I won't be asking AI for help again. All I wanted was a check on anything I had done wrong, and it did find an unmatched brace. I should not have let myself get sucked down the rabbit hole of its other complaints. Lesson learned.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by several, Today, 03:53 AM
                  0 responses
                  11 views
                  0 likes
                  Last Post several
                  by several
                   
                  Started by lucyb, Today, 03:38 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post lucyb
                  by lucyb
                   
                  Started by JMont1, Today, 03:05 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post JMont1
                  by JMont1
                   
                  Started by llanqui, 12-27-2024, 07:18 AM
                  3 responses
                  102 views
                  0 likes
                  Last Post charlesthomas  
                  Started by ronniecorrigan, Yesterday, 02:34 PM
                  2 responses
                  13 views
                  0 likes
                  Last Post ronniecorrigan  
                  Working...
                  X