﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/css' href='https://stocksharp.ru/css/style.css'?>
<?xml-stylesheet type='text/css' href='https://stocksharp.ru/css/bbeditor.css'?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html">Правило WhenBestAskPriceMore</title>
  <id>~/topic/2869/pravilo-whenbestaskpricemore/</id>
  <rights type="text">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  <updated>2026-06-19T20:25:45Z</updated>
  <logo>https://stocksharp.ru/images/logo.png</logo>
  <link href="https://stocksharp.ru/handlers/atom.ashx?category=topic&amp;id=2869" rel="self" type="application/rss+xml" />
  <entry>
    <id>https://stocksharp.ru/posts/m/20458/</id>
    <title type="text">Большое спасибо, понял </title>
    <published>2012-07-22T17:19:15Z</published>
    <updated>2012-07-22T17:19:15Z</updated>
    <author>
      <name>profso</name>
      <uri>https://stocksharp.ru/users/27638/</uri>
      <email>info@stocksharp.ru</email>
    </author>
    <content type="html">&lt;p&gt;Большое спасибо, понял&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.ru/posts/m/20454/</id>
    <title type="text">security.BestAsk = null у вас </title>
    <published>2012-07-20T10:45:11Z</published>
    <updated>2012-07-20T10:45:11Z</updated>
    <author>
      <name>Alexander</name>
      <uri>https://stocksharp.ru/users/2826/</uri>
      <email>info@stocksharp.ru</email>
    </author>
    <content type="html">&lt;p&gt;security.BestAsk = null у вас&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.ru/posts/m/20430/</id>
    <title type="text">System.ArgumentException: {&amp;quot;В стакане отсутствует котировка.\r\nИмя параметра: getQuote&amp;quot;} StackTrace...</title>
    <published>2012-07-18T17:50:21Z</published>
    <updated>2012-07-18T17:50:21Z</updated>
    <author>
      <name>profso</name>
      <uri>https://stocksharp.ru/users/27638/</uri>
      <email>info@stocksharp.ru</email>
    </author>
    <content type="html">&lt;p&gt;System.ArgumentException:
{&amp;quot;В стакане отсутствует котировка.\r\nИмя параметра: getQuote&amp;quot;}&lt;/p&gt;
&lt;p&gt;StackTrace:&lt;br /&gt;
в 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&amp;amp; handled)
в System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp;amp; handled)
в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp;amp; 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&amp;amp; 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()&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.ru/posts/m/20419/</id>
    <title type="text">стэктрейс приведите </title>
    <published>2012-07-17T22:10:31Z</published>
    <updated>2012-07-17T22:10:31Z</updated>
    <author>
      <name>Alexander</name>
      <uri>https://stocksharp.ru/users/2826/</uri>
      <email>info@stocksharp.ru</email>
    </author>
    <content type="html">&lt;p&gt;стэктрейс приведите&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.ru/posts/m/20379/</id>
    <title type="text">Коллеги, здравствуйте Помогите разобраться, пжлст, почему не работает правило WhenBestAskPriceMore Е...</title>
    <published>2012-07-16T18:09:11Z</published>
    <updated>2012-07-16T18:09:11Z</updated>
    <author>
      <name>profso</name>
      <uri>https://stocksharp.ru/users/27638/</uri>
      <email>info@stocksharp.ru</email>
    </author>
    <content type="html">&lt;p&gt;Коллеги, здравствуйте
Помогите разобраться, пжлст, почему не работает правило WhenBestAskPriceMore
Есть код Стратегии&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt;

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);
  
        }



&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;При Старте стратегии и обработке следующего кода&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt;

Security
                    .WhenBestAskPriceMore(d)
                    .Do(ReOr)
                    .Apply(this);


&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;выдает исключение&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;В стакане отсутствует котировка.
Имя параметра: getQuote&lt;/p&gt;
&lt;/blockquote&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
</feed>