Добрый день! написал оболочку для робота, где есть простой коннектор к КВИКу (по сути копия стандартного из примера) и вызов стратегии по кнопке (пока стратегия "пустая", т.е. по сути там заглушка). Так вот запускается стратегия успешно, а попытка закрыть ее кодом
_spreadSrategyMain.Stop()
выдает ошибку
2014/06/04 13:37:15.232|Error |Unhandled Exception|System.InvalidOperationException: Подключение не инициализировано. в StockSharp.Algo.Strategies.Strategy.#=q4hrz$6YIdirnmDAnvpHhXA8NGpJbvyeNK6Ny49wYh$0=() в StockSharp.Algo.Strategies.Strategy.#=q6ezYD4hkLnRhGfBuAWGxcsiiCgqZAeVPpl4qa$6YZ04=() в StockSharp.Algo.Strategies.Strategy.#=qUSpjJWgSBc7ywbSg5YmUcNwnebTr6TY8V9aDKKL0IwA=(ProcessStates #=q8ulus3HTmWh8DMibgZirrw==) в StockSharp.Algo.Strategies.Strategy.Stop() в QuikConnectWpfLevels.MainWindow.BtnManuallyTrade_Click(Object sender, RoutedEventArgs e) в d:\Работа\IFF\код\C#(S#)\work\QUIK\Levels\QuikConnectWpfLevels\QuikConnectWpfLevels\MainWindow.xaml.cs:строка 545 в 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.LegacyInvokeImpl(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() в QuikConnectWpfLevels.App.Main() в d:\Работа\IFF\код\C#(S#)\work\QUIK\Levels\QuikConnectWpfLevels\QuikConnectWpfLevels\obj\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.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) в System.Threading.ThreadHelper.ThreadStart()
Далее сравниваю код "посимвольно" с примером SampleSMA (в примере все работает на "ура")- различий существенных не наблюдаю :(. Помогите плз разобраться, в чем может быть причина ошибки "Подключение не инициализировано". Заранее благодарен
Kommentare (0)
Anmelden oder Konto erstellen, Melden Sie sich an oder registrieren Sie sich, um einen Kommentar zu hinterlassen
Noch keine Kommentare. Seien Sie der Erste!