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 muratb35, Today, 03:36 AM
    0 responses
    3 views
    0 likes
    Last Post muratb35  
    Started by fernlicht, Today, 02:16 AM
    2 responses
    9 views
    0 likes
    Last Post fernlicht  
    Started by fernlicht, 04-12-2021, 06:01 PM
    1 response
    28 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by memonolog, Today, 02:10 AM
    3 responses
    6 views
    0 likes
    Last Post memonolog  
    Started by orenytz, Today, 12:25 AM
    0 responses
    8 views
    0 likes
    Last Post orenytz
    by orenytz
     
    Working...
    X