﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/css' href='https://stocksharp.com/css/style.css'?>
<?xml-stylesheet type='text/css' href='https://stocksharp.com/css/bbeditor.css'?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html">Quoting стратегии</title>
  <id>~/topic/1232/quoting-strategii/</id>
  <rights type="text">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  <updated>2026-06-14T09:50:16Z</updated>
  <logo>https://stocksharp.com/images/logo.png</logo>
  <link href="https://stocksharp.com/handlers/atom.ashx?category=topic&amp;id=1232" rel="self" type="application/rss+xml" />
  <entry>
    <id>https://stocksharp.com/posts/m/4668/</id>
    <title type="text">Serg: Если у кого-то работает MarketQuotingStrategy или BestByPriceQuotingStrategy или любая другая ...</title>
    <published>2010-11-18T14:27:02Z</published>
    <updated>2010-11-18T14:27:02Z</updated>
    <author>
      <name>Mikhail Sukhov</name>
      <uri>https://stocksharp.com/users/201/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Serg:&lt;/strong&gt;
Если у кого-то работает MarketQuotingStrategy или BestByPriceQuotingStrategy или любая другая основанная на QuotingStrategy киньте плиз пример.
Спасибо.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Логирование стратегий сделайте плиз. И выложите текстом. Так пока не понятно.&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/4655/</id>
    <title type="text">Если у кого-то работает MarketQuotingStrategy или BestByPriceQuotingStrategy или любая другая основа...</title>
    <published>2010-11-17T19:07:25Z</published>
    <updated>2010-11-17T19:07:25Z</updated>
    <author>
      <name>Serg</name>
      <uri>https://stocksharp.com/users/484/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Если у кого-то работает MarketQuotingStrategy или BestByPriceQuotingStrategy или любая другая основанная на QuotingStrategy киньте плиз пример.
Спасибо.&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/4652/</id>
    <title type="text">Сколько не мучал ничего не получильсь... ээхх. Было решено унаследоваться от стратегии BestByPriceQu...</title>
    <published>2010-11-17T17:42:01Z</published>
    <updated>2010-11-17T17:42:01Z</updated>
    <author>
      <name>Serg</name>
      <uri>https://stocksharp.com/users/484/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Сколько не мучал ничего не получильсь... ээхх. Было решено унаследоваться от стратегии BestByPriceQuotingStrategy&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    class BBMB : BestByPriceQuotingStrategy
    {
        public BBMB(Order o, Unit u) : base(o, u)
        { }

        protected override StrategyProcessResults OnProcess()
        {
            return base.OnProcess();
        }

        protected override void OnRunned()
        {
            base.OnRunned();
        }

        protected override void OnRunning()
        {
            Trader.QuotesChanged += new System.Action&amp;lt;IEnumerable&amp;lt;MarketDepth&amp;gt;&amp;gt;(Trader_QuotesChanged);
            base.OnRunning();
        }

        void Trader_QuotesChanged(IEnumerable&amp;lt;MarketDepth&amp;gt; obj)
        {
            OnProcess();
        }
        
        protected override void OnStopping()
        {
            Trader.QuotesChanged -= new System.Action&amp;lt;IEnumerable&amp;lt;MarketDepth&amp;gt;&amp;gt;(Trader_QuotesChanged);
            base.OnStopping();
        }
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;В главной стратегии код был немного переделан:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        protected override StrategyProcessResults OnProcess()
        {
            if (ProcessState == StrategyProcessStates.Stopping)
                return StrategyProcessResults.Stop;
            
            if (ChildStrategies.Count == 0)
            {
                this.Volume = 3;
                Order o = CreateOrder(OrderDirections.Sell, 1754);
                Unit u = new Unit()
                {
                    Security = this.Security,
                    Type = UnitTypes.Point,
                    Value = 0.02
                };

                var ss = new BBMB(o, u) { IsParallel = true};
                AddLog(StrategyErrorStates.Warning, ss.PriceExchange.ToString(), this);
                this.ChildStrategies.Add(ss);
                ss.Start();
            }
            
            return StrategyProcessResults.Continue;
        }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Теперь заявка выставляется, но почему то по цене 100р когда в стакане около 1750.
При различных значения u.Value от 0.01 до 100 (с разными шагами) значение цены заявки равнялась 100.&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/4634/</id>
    <title type="text">Приветствую всех! class Abi : Strategy { public Abi() : base() { } void Trader_QuotesChanged(IEnumer...</title>
    <published>2010-11-17T08:09:08Z</published>
    <updated>2010-11-17T08:09:08Z</updated>
    <author>
      <name>Serg</name>
      <uri>https://stocksharp.com/users/484/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Приветствую всех!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;class Abi : Strategy
    {
        public Abi()
            : base()
        {
        }

        void Trader_QuotesChanged(IEnumerable&amp;lt;MarketDepth&amp;gt; obj)
        {
            OnProcess();
        }

        protected override void OnRunned()
        {
            base.OnRunned();
        }

        protected override void OnRunning()
        {
            Trader.QuotesChanged += Trader_QuotesChanged;
            Trader.RegisterQuotes(Security);
            base.OnRunning();
        }

        protected override StrategyProcessResults OnProcess()
        {
            if (ProcessState == StrategyProcessStates.Stopping)
            {
                return StrategyProcessResults.Stop;
            }
            
            if (ChildStrategies.Count == 0)
            {
                
                this.Volume = 3;
                var s = new MarketQuotingStrategy(
                    CreateOrder(OrderDirections.Sell, Security.BestAsk.Price + 2),
                    new Unit()
                    {
                        Security = this.Security,
                        Type = UnitTypes.Step,
                        Value = 1
                    },
                    1);
                
                this.ChildStrategies.Add(s);
                s.Start();
            }
            return StrategyProcessResults.Continue;
        }
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Подскажите  плиз что неправильно в этом коде или как должна работать MarketQuotingStrategy?
Если выставить из Abi стратегии заявку она встает. Стакан выводиться. По логу видно что родительская и дочерняя стратегии стартовали. Но больше никаких действий не происходит. Инструмент лукойл. Указываю цену на 2 рубля выше лучшего аска в надежде что MarketQuotingStrategy выставит заявку и начнет ее двигать.&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
</feed>