Ошибка при добавлении дочерней стратегии

Ошибка при добавлении дочерней стратегии
Atom
06.10.2011
Serg


Код на картинке вызываться единожды но дает такую ошибку. Ранее не замечал. Версия 4.0.1 последняя с codeplex'a.

Да, и удалил кусок :

{
    Trader = this.Trader
}

Теги:


Спасибо:


Mikhail Sukhov

Фотография
Дата: 06.10.2011
Ответить


Скрины - это, конечно, интересно. Но лучше вместо них stack trace.

Спасибо:

Serg

Фотография
Дата: 06.10.2011
Ответить


stack trace

в System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) в System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) в System.Collections.Generic.Dictionary2.Add(TKey key, TValue value) в Hardcodet.Wpf.GenericTreeView.ItemMonitor1.RegisterItem(String itemKey, ICollection1 childItems) в Hardcodet.Wpf.GenericTreeView.TreeViewBase1.CreateItemNode(T item, IList parentNodes, TreeLayout layout) в Hardcodet.Wpf.GenericTreeView.ItemMonitor1.HandleNewChildItems(ICollection1 observed, NotifyCollectionChangedEventArgs e) в Hardcodet.Wpf.GenericTreeView.ItemMonitor1.OnItemCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) в System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) в System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) в System.Collections.ObjectModel.ObservableCollection1.InsertItem(Int32 index, T item) в Ecng.Xaml.ThreadSafeObservableCollection1.InsertItem(Int32 index, T item) в System.Collections.ObjectModel.Collection1.Add(T item) в StockSharp.Xaml.LogSourceNode.<>c__DisplayClass6.b__5() в Ecng.Xaml.XamlHelper.GuiAsync(Dispatcher dispatcher, Action action, DispatcherPriority priority) в Ecng.Xaml.XamlHelper.GuiAsync(Dispatcher dispatcher, Action action) в Ecng.Xaml.XamlHelper.GuiAsync(DispatcherObject obj, Action action) в StockSharp.Xaml.LogSourceTree.StockSharp.Xaml.ILogSourceNodeModel.GuiSync(Action a) в StockSharp.Xaml.LogSourceNode.OnChildSourcesAdded(ILogSource s) в Ecng.Common.DelegateHelper.SafeInvoke(Action1 handler, T arg) в Ecng.Collections.NotifyList2.OnAdded(TInner item) в System.Action1.Invoke(T obj) в Ecng.Common.DelegateHelper.SafeInvoke(Action1 handler, T arg) в StockSharp.Algo.Strategies.Strategy.#=qzU2Jp_2HXcFVV_jbej8pmCWakJ6hu3OYzTIORb57i3I=.OnAdded(Strategy #=qd0mx3YaQ$9B9CfHUBWKmzA==) в Ecng.Collections.BaseCollection1.Add(T item) в Ecng.Collections.SynchronizedCollection1.Add(T item) в syntetictrader.SynteticStrategy.CreateChildeSOA(Security sec, Decimal strike, DateTime expdt) в E:\Programming\visual studio\syntetictrader\syntetictrader\syntetictrader\SynteticStrategy.cs:строка 135 в syntetictrader.SynteticStrategy.TryCreateChilde(String seccode, Decimal strike, DateTime expdt) в E:\Programming\visual studio\syntetictrader\syntetictrader\syntetictrader\SynteticStrategy.cs:строка 114 в syntetictrader.MainWindow.button5_Click(Object sender, RoutedEventArgs e) в E:\Programming\visual studio\syntetictrader\syntetictrader\syntetictrader\MainWindow.xaml.cs:строка 214 в System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) в System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) в System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) в System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) в System.Windows.Controls.Primitives.ButtonBase.OnClick() в System.Windows.Controls.Button.OnClick() в System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) в System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e) в System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) в System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) в System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) в System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) в System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) в System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) в System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) в System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) в System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) в System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) в System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) в System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) в System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) в System.Windows.Input.InputManager.ProcessStagingArea() в System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) в System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) в System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) в System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) в System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) в MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) в System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) в MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) в System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) в System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) в System.Windows.Threading.Dispatcher.Run() в System.Windows.Application.RunDispatcher(Object ignore) в System.Windows.Application.RunInternal(Window window) в System.Windows.Application.Run(Window window) в System.Windows.Application.Run() в syntetictrader.App.Main() в E:\Programming\visual studio\syntetictrader\syntetictrader\syntetictrader\obj\x86\Debug\App.g.cs:строка 0 в System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) в System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) в Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() в System.Threading.ThreadHelper.ThreadStart_Context(Object state) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) в System.Threading.ThreadHelper.ThreadStart()

Спасибо:

Serg

Фотография
Дата: 06.10.2011
Ответить


Перевел одну из старых версий кода с 3.6.2 на 4.0.1

var ocap = new OpenCloseArbitragePair(mts, ots, OrderDirections.Buy, DeltaOpen);
this.ChildStrategies.Add(ocap);

var ocap1 = new OpenCloseArbitragePair(mts, ots, OrderDirections.Sell, DeltaClose);
this.ChildStrategies.Add(ocap1);

после добавления второй дочерней стратегии(ocap1) вылетает это:

в System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) в System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) в System.Collections.Generic.Dictionary2.Add(TKey key, TValue value) в Hardcodet.Wpf.GenericTreeView.ItemMonitor1.RegisterItem(String itemKey, ICollection1 childItems) в Hardcodet.Wpf.GenericTreeView.TreeViewBase1.CreateItemNode(T item, IList parentNodes, TreeLayout layout) в Hardcodet.Wpf.GenericTreeView.ItemMonitor1.HandleNewChildItems(ICollection1 observed, NotifyCollectionChangedEventArgs e) в Hardcodet.Wpf.GenericTreeView.ItemMonitor1.OnItemCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) в System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) в System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) в System.Collections.ObjectModel.ObservableCollection1.InsertItem(Int32 index, T item) в Ecng.Xaml.ThreadSafeObservableCollection1.InsertItem(Int32 index, T item) в System.Collections.ObjectModel.Collection1.Add(T item) в StockSharp.Xaml.LogSourceNode.<>c__DisplayClass6.b__5() в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) в MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) в System.Windows.Threading.DispatcherOperation.InvokeImpl() в System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) в System.Threading.ExecutionContext.runTryCode(Object userData) в System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) в System.Windows.Threading.DispatcherOperation.Invoke() в System.Windows.Threading.Dispatcher.ProcessQueue() в System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) в MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) в System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) в MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) в System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) в System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) в System.Windows.Threading.Dispatcher.Run() в System.Windows.Application.RunDispatcher(Object ignore) в System.Windows.Application.RunInternal(Window window) в System.Windows.Application.Run(Window window) в System.Windows.Application.Run() в rts_arb.App.Main() в F:\Programming\VC\RTS_Arbitrage\rts_arb\rts_arb\obj\x86\Debug\App.g.cs:строка 0 в System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) в System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) в Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() в System.Threading.ThreadHelper.ThreadStart_Context(Object state) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) в System.Threading.ThreadHelper.ThreadStart()

Это в 4.0.1 проблема или я опять чего недоглядел в изменениях?

Спасибо:

Alexander

Фотография
Дата: 06.10.2011
Ответить


Какая-то проблема с MonitorWindow при работе дочерних стратегий

Спасибо:

Serg

Фотография
Дата: 06.10.2011
Ответить


аа.. Спасибо за наводку. Попробую без него.

UPD: да действительно. Убрал монитор из слушателей логгера и все сразу заработало

Спасибо:

Alexander

Фотография
Дата: 06.10.2011
Ответить


Serg: аа.. Спасибо за наводку. Попробую без него

и вам спасибо. Попробуем пофиксить :)

Спасибо:


Добавить файлы через драг-н-дроп, , или вставить из буфера обмена.

loading
clippy