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 ageeholdings, Today, 07:43 AM
    0 responses
    6 views
    0 likes
    Last Post ageeholdings  
    Started by pibrew, Today, 06:37 AM
    0 responses
    4 views
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    12 views
    0 likes
    Last Post burtoninlondon  
    Working...
    X