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 [B]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)
    [/B]   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:


    #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 rdtdale, Today, 01:02 PM
    0 responses
    1 view
    0 likes
    Last Post rdtdale
    by rdtdale
     
    Started by alifarahani, Today, 09:40 AM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by RookieTrader, Today, 09:37 AM
    4 responses
    18 views
    0 likes
    Last Post RookieTrader  
    Started by PaulMohn, Today, 12:36 PM
    0 responses
    6 views
    0 likes
    Last Post PaulMohn  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    41 views
    0 likes
    Last Post love2code2trade  
    Working...
    X