Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ArgumentOutOfRangeException

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

    ArgumentOutOfRangeException

    Hi,

    I experienced a new thread timing race condition type issue. Randomly and rarely occurs but once it occurs, it keeps going until the app is restarted. This is on a laptop system (not my usual system).

    Please do not request additional info. In fact if you could provide which type of list() it is accessing there it might be helpful (charts?, shapes? bars data?). If nothing else this is here for searchable purposes.

    Thanks,
    Chris

    It looks like its not coming directly from custom code: When life gives you gold (stack trace) just throw it away?

    ion: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    at System.ThrowHelper.ThrowArgumentOutOfRangeExceptio n(ExceptionArgument argument, ExceptionResource resource)
    at System.Collections.Generic.List`1.get_Item(Int32 index)
    at NinjaTrader.Gui.Chart.ChartControl.ApplyNinjaScrip ts()
    at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
    at System.Windows.Threading.Dispatcher.Invoke(Action callback)
    at NinjaTrader.Gui.Chart.ChartControl.OnBarsToLoadCol lectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
    at System.Collections.ObjectModel.ObservableCollectio n`1.OnCollectionChanged(NotifyCollectionChangedEve ntArgs e)
    at System.Collections.ObjectModel.ObservableCollectio n`1.RemoveItem(Int32 index)
    at System.Collections.ObjectModel.Collection`1.Remove (T item)
    at NinjaTrader.Gui.Chart.ChartControl.<>c__DisplayCla ss479_1.<OnGetBarsCallback>b__0(Bars bars, ChartControl chartControl, ChartBars chartBars2)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeIn ternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Delegate.DynamicInvokeImpl(Object[] args)
    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)
    2017-01-26 12:48:57:140 *************** unhandled exception trapped ***************
    2017-01-26 12:48:57:140 Exception has been thrown by the target of an invocation.
    2017-01-26 12:48:57:141 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    P

    #2
    Hello crokusek,

    Thank you for your post.

    NinjaTrader was unable to access the bars collection for the NinjaScript object. As you requested no details be requested I will leave this open to your response.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Waxavi, Today, 02:00 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by alifarahani, Today, 09:40 AM
    5 responses
    23 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Kaledus, Today, 01:29 PM
    4 responses
    12 views
    0 likes
    Last Post Kaledus
    by Kaledus
     
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    16 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by PhillT, Today, 02:16 PM
    2 responses
    7 views
    0 likes
    Last Post PhillT
    by PhillT
     
    Working...
    X