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 EyeSightMaxInfo, Today, 11:18 AM
    0 responses
    1 view
    0 likes
    Last Post EyeSightMaxInfo  
    Started by Dan_TUK, Today, 08:59 AM
    6 responses
    16 views
    0 likes
    Last Post Dan_TUK
    by Dan_TUK
     
    Started by lucyb, 06-23-2024, 08:33 AM
    9 responses
    33 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by RISKYBUSINEZZ, Today, 10:43 AM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by TradeUP1, Today, 10:58 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X