Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

NT stuck on loading logo after installing Add-On

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

    NT stuck on loading logo after installing Add-On

    Hello,

    I have tried writing my addon, it's just an add-on that connect if disconnect, and write a connection_status.txt
    But now NT 8 doesnt open anymore, it keep looping on logo.

    I can't go to NT to delete my addon, i have tried opening it in safe mode but there is no assemblies, and not addons. I have deleted the addon in bin/custom/addons, same problem. I have deleted the db folder, same problem.

    How to remove the addon without going to NT?

    This was my addon code:

    Code:
    using System;
    using System.IO;
    using System.Linq;
    using System.Timers;
    using NinjaTrader.Cbi;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.NinjaScript.AddOns;
    
    namespace NinjaTrader.NinjaScript.AddOns
    {
        public class ConnnectionTest : NinjaTrader.NinjaScript.AddOnBase
        {
            private Timer timer;
            private string filePath = @"C:\ConnectionStatus.txt";
            private Connection myConnection;
    
            public ConnnectionTest()
            {
                // Create a timer with a 5-second interval
                timer = new Timer(5000);
                timer.AutoReset = true; // Set AutoReset to true for periodic execution
                timer.Elapsed += OnTimerElapsed;
                timer.Start();
    
                // Connect to NinjaTrader if not connected
                if (myConnection == null || myConnection.Status != ConnectionStatus.Connected)
                {
                    myConnection = Connect("My NinjaTrader");
                }
            }
    
            private void OnTimerElapsed(object sender, ElapsedEventArgs e)
            {
                // Get the connection status of the order feed
                ConnectionStatus status = myConnection?.Status ?? ConnectionStatus.Disconnected;
    
                // Write the connection status to the text file
                File.WriteAllText(filePath, status.ToString());
    
                // If connection status is not connected, try to reconnect
                if (status != ConnectionStatus.Connected)
                {
                    myConnection = Connect("My NinjaTrader");
                }
            }
    
            private Connection Connect(string connectionName)
            {
                try
                {
                    ConnectOptions connectOptions = null;
                    lock (Core.Globals.ConnectOptions)
                        connectOptions = Core.Globals.ConnectOptions.FirstOrDefault(o => o.Name == connectionName);
    
                    if (connectOptions == null)
                    {
                        NinjaTrader.Code.Output.Process("Could not connect. No connection found.", PrintTo.OutputTab1);
                        return null;
                    }
    
                    lock (Connection.Connections)
                    {
                        if (Connection.Connections.FirstOrDefault(c => c.Options.Name == connectionName) == null)
                        {
                            Connection connect = Connection.Connect(connectOptions);
    
                            // Only return connection if successfully connected
                            if (connect.Status == ConnectionStatus.Connected)
                                return connect;
                            else
                                return null;
                        }
                    }
    
                    return null;
                }
                catch (Exception error)
                {
                    NinjaTrader.Code.Output.Process("Connect exception: " + error.ToString(), PrintTo.OutputTab1);
                    return null;
                }
            }
    
        }
    }
    ​

    #2
    Hello smartromain,

    Thank you for your post.

    If you have deleted the AddOn file from bin/Custom/AddOn, it may not be related to your add-on script.

    To confirm, are you able to open the platform in Safe Mode?

    Please also send me your log and trace files so that I may look into what occurred.

    You can do this by going to the Control Center-> Help-> Email Support

    Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

    Please reference the following ticket number in the body of the email: Case Number:04401236 ATTN Gaby​
    Gaby V.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by smartromain, Today, 02:52 AM
    0 responses
    8 views
    0 likes
    Last Post smartromain  
    Started by Marklhc1988, 04-19-2023, 11:11 AM
    12 responses
    571 views
    1 like
    Last Post victor68133  
    Started by nicthe, Yesterday, 02:58 PM
    1 response
    9 views
    0 likes
    Last Post nicthe
    by nicthe
     
    Started by percy3687, 05-17-2024, 12:28 AM
    3 responses
    30 views
    0 likes
    Last Post percy3687  
    Started by SilverSurfer1, Yesterday, 01:33 PM
    0 responses
    13 views
    0 likes
    Last Post SilverSurfer1  
    Working...
    X