• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8.0.4.0-Playback-MR-System.ArgumentException: Destination array was not long enough

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

    NT8.0.4.0-Playback-MR-System.ArgumentException: Destination array was not long enough

    Ugh, I thought all these exception thrown by the target of invocation had been solved.

    This is a new variation that I've never seen.

    Happened around 8 months out of 36 months into replay. Slightly new variation in my code. Replay continued. Results might be incorrect.

    I'll test on another machine and re-test on this machine. I'll see if I can narrow down to the day and what happened.



    Code:
    2017-02-01 21:54:58:211 (Playback Connection) Cbi.Account.PositionUpdateCallback: instrument='ES ##-##' account='Playback101' avgPrice=0 quantity=0 marketPosition=Flat operation=Remove
    2017-02-01 21:54:58:215 *************** unhandled exception trapped ***************
    2017-02-01 21:54:58:215 Exception has been thrown by the target of an invocation.
    2017-02-01 21:54:58:256 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
       at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
       at System.Collections.Generic.List`1.CopyTo(T[] array, Int32 arrayIndex)
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
       at NinjaTrader.Gui.NinjaScript.StrategiesGrid.CalculateRealizedProfit(StrategyBase strategy, Instrument instrument)
       at NinjaTrader.Gui.NinjaScript.StrategiesGrid.<OnPositionUpdate>b__69_0(PositionEventArgs e)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
    2017-02-01 21:54:58:398 (Playback Connection) Cbi.Account.AccountItemCallback: account='Playback101' accountItem=CashValue currency=UsDollar value=*****

    This is close, but not exactly the same:

    http://ninjatrader.com/support/forum...stIndex+length

    #2
    Hello sledge,

    I took a look at the linked post and the issue that was created from it. I tried the sample we had used to confirm with the other post and was unable to see the same result in the current release. As you noted it seems similar but different so I am unsure if these two items are related. If you happen to have create a sample or confirm this on your other machines, could you provide the sample along with setup steps to try and run this?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by U0000999, Yesterday, 11:49 PM
    2 responses
    7 views
    0 likes
    Last Post U0000999  
    Started by Mberg, Today, 03:29 AM
    0 responses
    4 views
    0 likes
    Last Post Mberg
    by Mberg
     
    Started by TazoTodua, Today, 03:24 AM
    0 responses
    4 views
    0 likes
    Last Post TazoTodua  
    Started by ahadari28, Yesterday, 04:01 PM
    2 responses
    9 views
    0 likes
    Last Post ahadari28  
    Started by NinjaCustomer, Today, 12:14 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Marco  
    Working...
    X