Правило WhenBestAskPriceMore

Правило WhenBestAskPriceMore
Atom
7/16/2012
profso


Коллеги, здравствуйте
Помогите разобраться, пжлст, почему не работает правило WhenBestAskPriceMore
Есть код Стратегии
Code


namespace ROBOCOP
{
    public class MyStrategy:Strategy
    {
        
        public MyStrategy()
        {
        
        }

       protected override void OnStarting()
        {                      

            try
            {
                var d = new Unit(0.003m);

                Security
                    .WhenBestAskPriceMore(d)
                    .Do(ReOr)
                    .Apply(this);
            }
            catch (ApplicationException ex) 
            {
                MessageBox.Show(ex.Message);
            }
            base.OnStarting();
        }
       
       public void ReOr()
        {
          
           var direction = OrderDirections.Buy;

           var order = this.CreateOrder(direction, Security.BestAsk.Price, Volume);

           RegisterOrder(order);
  
        }




При Старте стратегии и обработке следующего кода
Code


Security
                    .WhenBestAskPriceMore(d)
                    .Do(ReOr)
                    .Apply(this);


выдает исключение
Quote:

В стакане отсутствует котировка.
Имя параметра: getQuote







Tags:


Thanks:


Alexander

Avatar
Date: 7/18/2012
Reply


стэктрейс приведите
Thanks:

profso

Avatar
Date: 7/18/2012
Reply


System.ArgumentException:
{"В стакане отсутствует котировка.\r\nИмя параметра: getQuote"}

StackTrace:
в StockSharp.Algo.MarketRuleHelper.#=qcOhC0WJE5q4AmQIoC1tt4Ds2$UQigPCCjmyvhEP1k6o=(Unit #=qEByPJKbHyy3CiH5U8QDYwA==, Func`1 #=qdGG7e$d1RGDmUleVdQSq3g==, Boolean #=qhVAHKFEyjWYtI7z5DD0IJA==)
в StockSharp.Algo.MarketRuleHelper.WhenBestAskPriceMore(Security security, Unit price)
в ROBOCOP.MyStrategy.OnStarting() в C:\Users\Алексей\Documents\C#\Мои проекты\ROBOCOP\ROBOCOP\MyStrategy.cs:строка 28
в StockSharp.Algo.Strategies.Strategy.#=qDUnL50DTyxJPEcqJDPS9zHU90r86WPbXv77_6gajAf8=(ProcessStates #=qzr55ep1Q_tdNk3wYz1P3uQ==)
в StockSharp.Algo.Strategies.Strategy.Start()
в ROBOCOP.MainWindow.Start_Click(Object sender, RoutedEventArgs e) в C:\Users\Алексей\Documents\C#\Мои проекты\ROBOCOP\ROBOCOP\MainWindow.xaml.cs:строка 170
в 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.Application.RunDispatcher(Object ignore)
в System.Windows.Application.RunInternal(Window window)
в System.Windows.Application.Run(Window window)
в System.Windows.Application.Run()
в ROBOCOP.App.Main() в C:\Users\Алексей\Documents\C#\Мои проекты\ROBOCOP\ROBOCOP\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()


Thanks:

Alexander

Avatar
Date: 7/20/2012
Reply


security.BestAsk = null у вас
Thanks: profso

profso

Avatar
Date: 7/22/2012
Reply


Большое спасибо, понял
Thanks:


Attach files by dragging & dropping, , or pasting from the clipboard.

loading
clippy