Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Index Out of Range Message in Log

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

    Index Out of Range Message in Log

    I am continuously getting this error message in my log. It appears to be related to OrderFlow which I am using on my charts. Specifically I am using:
    Orderflow Cumulative Delta
    Orderflow Volume Profile

    On a separate chart I am using:
    Orderflow Volumetric, set to one minute bars.

    Here's the error:

    Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at Aystem.ThrowHelper.ThrowArgumentOutOfRangeExceptio n(ExceptionArgument argument, ExceptionResource resource)
    at NinjaTrader.NinjaScript.Series`1.get_Item(Int32 barsAgo) at NinjaTrader.NinjaScript.AddOns.OrderflowProcessorA gg.ProcessMarketData(MarketDataEventArgs data)
    at NinjaTrader.NinjaScript.AddOns.OrderflowProcessorA gg.OnMarketData(MarketDataEventArgs data)

    I don't know if this error is causing any performance issues. I am generally able to trade just fine, though just in the last few days I have been getting lots of disconnects. Don't know if they are related but I think this error message has been going on for a long time.

    Any idea where I can go to fix this issue?

    Thanks

    Dave

    Attached Files

    #2
    Don't know if this will help but here is the trace file from the last time I started NT.
    Last edited by NinjaTrader_Jason; 09-17-2023, 01:12 AM.

    Comment


      #3
      These errors are an absolute bugger to track down.

      Years ago, some developer at Ninjatrader thought it would be a brilliant idea to globally catch Ninjascript exceptions and print only the error message without any stack trace information about the method or line number.

      this was actually a terrible decision and has cost millions of lost hours for thousands of developers over the years.

      The only way is to visually inspect your code and try to figure out what is happening. Or launch visual studio and attach the debugger and try to trigger the exception while in debug. This will cause the debugger to trap the excel and flag up the exact place in code it’s happening.

      Comment


        #4
        Thank you Kevinenergy. Messing around with visual studio is well beyond my current coding skills, (which at best can be described as cut and paste). I've removed all of the strategies I have worked on in the past so they won't interfere with compiling, (though they weren't anyway) so I'm not sure what to do next. I'll see if I can figure out the debugger and visual studio you suggested.
        Should be fun.
        Thanks
        DaveN

        Comment


          #5
          this is off the top of my head but I think it’s fairly straightforward:



          Download and install visual studio community edition

          While that’s installing, Right click the Ninjascript editor and select “Debug mode”

          Then recompile in Ninjascript editor. (It needs to be compiled in Debug mode for this to work)

          I think there is a visual studio button on the toolbar of the Ninjascript editor. Click that after installation is done and it should launch in visual studio. (Failing that, find the .csproj file in Documents/Ninjatrader/bin/custom and open that in visual studio)

          within visual studio, go to “Debug” menu and choose “attach to process”. A list of all running processes will appear. Scroll through it, find Ninjatrader and attach the debugger.

          then go back to the Ninjatrader application. Do what you need to do to trigger the exception. When it triggers, visual studio will point out in the code where it happened.

          Comment


            #6
            Hello Dave,

            If you still experience the error, please send me all your log and trace files from within NinjaTrader Desktop, so I can investigate.
            • Go to Control Center-->Help-->Email Support
            • Set the To field to Platform Technical Support
            • Enter "Att Jason, 04046185" in the "Subject" field
            • Enter any text under 'Please enter any information that you feel will help us resolve your inquiry'.
            • Make sure "Log and trace files" is enabled
            • Click Send

            I don't see connection losses related to the error. Can you please troubleshoot the connection losses with the steps below. Test for the connection losses after each step.
            • Restart NinjaTrader
            • Restart your modem and (if applicable) router
            • Restart your PC/server
            • Clear your DNS [*=1]Open the Command Prompt: https://www.howtogeek.com/235101/10-...in-windows-10/ [*=1]In the command prompt, run this command: ipconfig /flushdns
            • If you are not already and the option is available to you, connect to the internet using an ethernet cable. Wireless connections are significantly more unreliable.
            • Ensure exceptions have been added into any firewall/antivirus/backup programs for the Documents > "NinjaTrader 8" folder.
            • Ensure that your computer is not turning off your Network Adapter to conserve power: [*=1]Right-click on your Start button [*=1]Select 'Device Manager' [*=1]Expand 'Network Adapters' [*=1]Right-click on your Network Adapter and select Properties > Power Management [*=1]Uncheck 'Allow the computer to turn off this device to save power' option [*=1]Click 'OK' to save the changes [*=1]Do this for all Network Adapters
            JasonNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by DroneBlackCa, Today, 05:17 AM
            0 responses
            2 views
            0 likes
            Last Post DroneBlackCa  
            Started by tradingnasdaqprueba, 04-09-2024, 09:52 AM
            7 responses
            49 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by deamenvc, Today, 05:00 AM
            0 responses
            3 views
            0 likes
            Last Post deamenvc  
            Started by r68cervera, Today, 04:45 AM
            0 responses
            5 views
            0 likes
            Last Post r68cervera  
            Started by r68cervera, 04-25-2024, 05:29 AM
            2 responses
            19 views
            0 likes
            Last Post r68cervera  
            Working...
            X