Пример #1
0
        public void Flush()
        {
            if (IsStopped)
            {
                return;
            }

            IsStopped = true;

            Thread.Sleep(30 * 1000);

            Model.Flush();

            FlushOrder fo = new FlushOrder();

            fo.Flush((sb, nk) =>
            {
                foreach (var v in Matcher.Container.Orders.Values)
                {
                    foreach (var s in v.BuyQueue)
                    {
                        if (s.State == OrderState.部分成交 || s.State == OrderState.等待中)
                        {
                            fo.FlushTempOrder(sb, s, nk);
                        }
                    }
                    foreach (var b in v.SellQueue)
                    {
                        if (b.State == OrderState.部分成交 || b.State == OrderState.等待中)
                        {
                            fo.FlushTempOrder(sb, b, nk);
                        }
                    }
                }
            });
            Singleton <TextLog> .Instance.Info("期权交易系统成功停止");

            log.Flush();
        }