• 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.


No announcement yet.

Partner 728x90


B12 Race Condition - Connect on Startup to Data Provider

  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by strategesis View Post
    I have some workspaces which show the problem with some reliability. However, they do reference my code. I'd have to also provide you with protected DLLs for my indicators. Or, if you really need to see the source code (debugging,) I'd require that you sign an NDA.
    I was having this problem. However I dispose of my objects straight after usage within OnRender. Hope that helps..........

    I'd require that you sign an NDA.[/
    LOL.... that means nothing in this industry


      This scenario still an issue in RC2, but narrower in scope

      OK, a "connect on startup" race still present in RC2, and i've isolated it to one specific case. I have an indicator that loads 5 1-minute bar series in State.Configure

      AddDataSeries({SOME INSTRUMENT}, Data.BarsPeriodType.Minute, 1, Data.MarketDataType.Last);

      Having this indicator on a chart that gets loaded from a workspace while connecting to my data provider yields this stack trace every time:

      2016-10-11 14:33:16:616 *************** unhandled exception trapped ***************
      2016-10-11 14:33:16:616 Exception has been thrown by the target of an invocation.
      2016-10-11 14:33:16:617 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.
      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)

      EDIT -

      Getting this one as well, about 50% of the time:

      2016-10-11 15:15:37:955 ERROR: Data.Bars.ClearCache: System.IO.IOException: The process cannot access the file 'C:\Users\Lab4\Documents\NinjaTrader 8\db\cache\CME US Index Futures ETH.Pacific Standard Time\MINUTE\ES ##-##\Minute_1_4_Last_Close_Tick_Minute_1.20161005150 0.209912010000.LastSR.ntt' because it is being used by another process.
      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
      at System.IO.File.InternalDelete(String path, Boolean checkHost)
      at NinjaTrader.Data.BarsSeries.ClearCache(Instrument instrument, DateTime firstData2Clear, Boolean clearReplayCache)
      Last edited by RanchoDinero; 10-11-2016, 04:17 PM.


        Bump. Were you guys able to repro?


          On the original thread we were able to reproduce rendertarget unavailability during OnRender(). We have made code changes in next release to prevent this from happening during an OnRender() call. Were still working on some related cases which was brought up from this report so I don't have much else to update with.

          As to Rancho Dinero's case reported, we tried many variations and were unable to reproduce. We believe it to be a separate issue that needs to be looked into.. Rancho, would you be willing to work with me one on one and potentially test an advanced release next few days and work together on that if you had time? Please contact me at platformsupport at ninjatrader dot com ATTN: Product Management and reference this thread. I'll likely supply you a custom build + potentially try to grab a strategy to reproduce.

          Note: On your edit attached issue on file access, we had been working on this as well from a seperate report. Likely is resolved already in next build but again would work with you to isolate further if you had time.

          BrettNinjaTrader Product Management


          Latest Posts


          Topics Statistics Last Post
          Started by jamarc, Today, 02:30 AM
          1 response
          Last Post NinjaTrader_Jesse  
          Started by uday12, Yesterday, 04:19 PM
          1 response
          Last Post NinjaTrader_PaulH  
          Started by grose, Today, 06:53 AM
          2 responses
          Last Post grose
          by grose
          Started by Bobisam, Yesterday, 04:57 PM
          1 response
          Last Post NinjaTrader_PaulH  
          Started by voltlon, Yesterday, 05:18 PM
          1 response
          Last Post NinjaTrader_PaulH