Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Index was outside the bounds of the array

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

    Index was outside the bounds of the array

    I have no strategies attached, no indicators on any chart, but when I bring up the platform I get a dialog that pops up and looks like this:

    Click image for larger version

Name:	image.png
Views:	694
Size:	18.7 KB
ID:	1309447

    I know this is coming from a strategy I had attached in the strategies tab in the main control center, but it's not showing in there now. As you can see:
    Click image for larger version

Name:	image.png
Views:	641
Size:	61.8 KB
ID:	1309448
    So I went to the Trace folder and you can see the call stack in your trace logs. What I want is for you to tell me how to clear this out. Is there some files I can delete somewhere? What do I do to get rid of this?

    2024-07-02 09:27:01:914 Index was outside the bounds of the array.
    2024-07-02 09:27:01:930 System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at NinjaTrader.Gui.NinjaScript.StrategiesGrid.AddChil dCollection(StrategyBase strategyBase)
    at NinjaTrader.Gui.NinjaScript.StrategiesGrid.AddStra tegyToGrid(StrategyBase strategyBase)
    at NinjaTrader.Gui.NinjaScript.StrategiesGrid.OnLoade d(Object sender, RoutedEventArgs e)
    at System.Windows.EventRoute.InvokeHandlersImpl(Objec t source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.RaiseEventImpl(Dependency Object sender, RoutedEventArgs args)
    at System.Windows.BroadcastEventHelper.BroadcastEvent (DependencyObject root, RoutedEvent routedEvent)
    at System.Windows.BroadcastEventHelper.BroadcastLoade dEvent(Object root)
    at MS.Internal.LoadedOrUnloadedOperation.DoWork()
    at System.Windows.Media.MediaContext.FireLoadedPendin gCallbacks()
    at System.Windows.Media.MediaContext.FireInvokeOnRend erCallbacks()
    at System.Windows.Media.MediaContext.RenderMessageHan dlerCore(Object resizedCompositionTarget)
    at System.Windows.Media.MediaContext.RenderMessageHan dler(Object resizedCompositionTarget)
    at System.Windows.Interop.HwndTarget.OnResize()
    at System.Windows.Interop.HwndTarget.HandleMessage(Wi ndowMessage msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Interop.HwndSource.HwndTargetFilter Message(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation( Object o)
    at System.Windows.Threading.ExceptionWrapper.Internal RealCall(Delegate callback, Object args, Int32 numArgs)
    at System.Windows.Threading.ExceptionWrapper.TryCatch When(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
    2024-07-02 09:27:02:068 (My Live Account) NinjaTrader.Gui.ControlCenter.OnConnectionStatus.D ispatcherInvoke: Provider18 status=Connecting priceStatus=Connecting previousStatus=Disconnected previousPriceStatus=Disconnected errorCode=NoError nativeError=''
    2024-07-02 09:27:02:070 (My Live Account) Gui.ControlCenter.OnConnectionStatus.Adding: provider=Provider18 status=Connected priceStatus=Connected
    2024-07-02 09:27:02:110 Cbi.Instrument.RequestBars (to Provider): instrument='ES 09-24' from='7/2/2024 12:00:00 AM' to='7/2/2024 12:00:00 AM' period='1 Minute'
    2024-07-02 09:27:02:831 NinjaTrader.Gui.ControlCenter.OnConnectionStatus: foundPriceLoss=False foundTradeLoss=False foundConnectingStatus=False foundConnected=True
    2024-07-02 09:27:02:832 NinjaTrader.Gui.ControlCenter.OnConnectionStatus: Status=Connected
    2024-07-02 09:27:02:832 (My Live Account) NinjaTrader.Gui.ControlCenter.OnConnectionStatus.D ispatcherInvoke: Provider18 status=Connecting priceStatus=Connecting previousStatus=Connecting previousPriceStatus=Connecting errorCode=NoError nativeError=''
    2024-07-02 09:27:02:832 (My Live Account) Gui.ControlCenter.OnConnectionStatus.Adding: provider=Provider18 status=Connected priceStatus=Connected
    2024-07-02 09:27:02:832 NinjaTrader.Gui.ControlCenter.OnConnectionStatus: foundPriceLoss=False foundTradeLoss=False foundConnectingStatus=False foundConnected=True
    2024-07-02 09:27:02:832 NinjaTrader.Gui.ControlCenter.OnConnectionStatus: Status=Connected
    2024-07-02 09:27:02:842 (My Live Account) NinjaTrader.Gui.ControlCenter.OnConnectionStatus.D ispatcherInvoke: Provider18 status=Connected priceStatus=Connected previousStatus=Connecting previousPriceStatus=Connecting errorCode=NoError nativeError=''
    2024-07-02 09:27:02:842 (My Live Account) Gui.ControlCenter.OnConnectionStatus.Adding: provider=Provider18 status=Connected priceStatus=Connected
    2024-07-02 09:27:02:842 NinjaTrader.Gui.ControlCenter.OnConnectionStatus: foundPriceLoss=False foundTradeLoss=False foundConnectingStatus=False foundConnected=True
    2024-07-02 09:27:02:842 NinjaTrader.Gui.ControlCenter.OnConnectionStatus: Status=Connected
    2024-07-02 09:27:03:778 1 Chart Chart1Tab1 1 Ser 2 Ind 1 DrawObj​

    #2
    As an additional note, I can't create a new workspace to try to start over. It throws that exception when I go to the workspaces "new". It will let me load one of the default workspaces. I just can't create new ones.

    Comment


      #3
      I now have it down to a completely empty workspace with only the control center and the xml for the workspace has nothing in it but this:

      <?xml version="1.0" encoding="utf-8"?>
      <NinjaTrader>
      <NTWindows />
      </NinjaTrader>​

      and it still throws an exception.

      What on earth do I have to do to get rid of this exception you guys are throwing?

      Comment


        #4
        Hello dmisselhorn ​,

        Thank you for your message.

        This part here:

        System.IndexOutOfRangeException: Index was outside the bounds of the array.
        at NinjaTrader.Gui.NinjaScript.StrategiesGrid.AddChil dCollection(StrategyBase strategyBase)


        Would indicate this error is being caused by an implemented strategy.

        However, if you do not have any strategies, here is what I recommend:

        1. First try repairing your NinjaTrader 8 platform to try fixing this error. To complete a repair, do the following:
        • Shut down NinjaTrader 8
        • Go to your computer's Control Panel > Programs & Features (Note: search for 'Control Panel' to find it within the Windows Start Menu. This will be a different window than the Settings page)
        • Left-click once on NinjaTrader 8 > select 'Repair' above the list of available programs
        • Restart the platform after it finishes repairing, and test for this behavior again.
        • Here is a video I made for your reference: https://www.screencast.com/t/5RH7MjuaQiG

        ​2. If the same error persists after the repair, strategies are directly tied to the Database file wihin NT8. It may be that yours has become affected and needs to be replaced.

        So, I recommend you rename your database.

        You may rename your database to resolve this using the following steps:
        • Shutdown NinjaTrader, and navigate to the Windows File Explorer (Windows Key + E)
        • Go to the Documents/NinjaTrader 8/db folder
        • Right-click on "NinjaTrader.sqlite" and rename it to "NinjaTrader OLD.sqlite"
        • Here is a reference video: https://app.screencast.com/ffpxQ063SjZq9


        When you restart NinjaTrader, a fresh database file will automatically be created by the software. You should then be able to connect and your Charts should be loading properly.
        • Unfortunately, the following items stored in the old database will be lost - custom Trading Hours templates, custom Instruments/Instrument Lists, historical trade execution data, and saved Strategy Analyzer backtest results
        • Locally added Sim accounts will be removed, Sim101 will be reset, and any strategies will need to be re-added to the Strategies tab


        To prevent running into situations where you can potentially lose important data, we advise running regular backups via the built-in Backup feature in NinjaTrader.

        Please let us know if we can be of further assistance or you continue to have issues.​​
        Erick P.NinjaTrader Customer Service

        Comment


          #5
          The repair did not get rid of the issue, but renaming the database did. So it must have been a database issue. The exception is no longer thrown.

          Thanks for your assistance.

          Comment


            #6
            Originally posted by NinjaTrader_Erick View Post
            [*]Unfortunately, the following items stored in the old database will be lost - custom Trading Hours templates, custom Instruments/Instrument Lists, historical trade execution data, and saved Strategy Analyzer backtest results[*]Locally added Sim accounts will be removed, Sim101 will be reset, and any strategies will need to be re-added to the Strategies tab
            Hi Erick,

            A related question. I know it is possible to revert back to the old database, but are these "items" in the old database stored somewhere that can be recovered? Specially, custom watch lists are difficulat to recreate.

            Perhaps custom watch lists can be inculded under bin > Custum folders similar to incators, templates, etc. that can be recovered.

            Thanks.

            Comment


              #7
              It sounds like the issue you're encountering is likely due to a corrupted or problematic database. As a solution, you can try repairing the NinjaTrader 8 platform through the Control Panel's Programs & Features section. If the problem persists, renaming the database file located in the Documents/NinjaTrader 8/db folder should help, as this forces the platform to create a new, clean database upon restart. This often resolves such exceptions by clearing out any underlying issues within the old database.

              Comment


                #8
                Originally posted by w5l8nx1 View Post
                It sounds like the issue you're encountering is likely due to a corrupted or problematic database. As a solution, you can try repairing the NinjaTrader 8 platform through the Control Panel's Programs & Features section. If the problem persists, renaming the database file located in the Documents/NinjaTrader 8/db folder should help, as this forces the platform to create a new, clean database upon restart. This often resolves such exceptions by clearing out any underlying issues within the old database.
                Yes, that is the same as recommendation in Post #4. The issue is that some files such as custom watch lists, trade data, etc. will be missing and cannot be recovered unless reverting back to old database file.

                Comment

                Latest Posts

                Collapse

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