Пример #1
0
 public ReorderItem(Order up, ContractFuse cf, bool isHandelMax, PositionSummary pos, IMatch matcher)
 {
     this.matcher = matcher;
     Blaster.Log.Info(string.Format("平仓委托重新报价加入队列:{0}-大{1}-边{2},{3}-单{4}", up.Trader.Name, isHandelMax, cf.MaxPrice, cf.MinPrice, up.ToShortString()));
     this.order  = up; this.cf = cf; this.Pos = pos;
     HisOrderIds = new List <int> {
         up.Id
     };
     this.isHandleMax = isHandelMax;
     //引发熔断--
     cf.ShouldAccept(up);
     if (isHandelMax)
     {
         cf.OnMaxChanged += cf_OnMaxChanged;
     }
     else
     {
         cf.OnMinChanged += cf_OnMinChanged;
     }
     cf.Excutor.OnFuseOver += Excutor_OnFuseOver;
     CreateTime             = DateTime.Now;
     checkTimer             = new Timer();
     checkTimer.Interval    = ContractFuse.FuseSpanInMin / 2 * 60 * 1000;
     checkTimer.Elapsed    += checkTimer_Elapsed;
     checkTimer.Start();
 }
Пример #2
0
        public void Add(Order up, ContractFuse cf, bool isHandelMax, PositionSummary ps)
        {
            var feh = new ReorderItem(up, cf, isHandelMax, ps, this.matcher);

            feh.OnDone += feh_OnDone;
            list.Add(feh);
        }
Пример #3
0
 public MarketItem(MarketRecord mr, Contract c)
 {
     this.Contract        = c;
     this.fuser           = new ContractFuse(c, mr.FuseMax, mr.FuseMin);
     this.NewestPrice     = mr.NewestPrice;
     this.NewestDealPrice = mr.NewestDealPrice;
     this.Copis           = mr.Copies;
     this.Times           = mr.Times;
     this.Total           = mr.Total;
     this.OpenTotal       = mr.OpenTotal;
     this.SellCount       = mr.SellCount;
     this.BuyCount        = mr.BuyCount;
 }
Пример #4
0
 public MarketItem(Contract c)
 {
     this.Contract = c;
     fuser         = new ContractFuse(c);
 }
Пример #5
0
 /// <summary>
 /// 将委托放入重新报价队列
 /// </summary>
 /// <param name="o"></param>
 /// <param name="cf"></param>
 /// <param name="isFuseMax">是否是上边界发生变化时重新报价</param>
 protected void PutInReorder(Order o, ContractFuse cf, bool isFuseMax, PositionSummary pos)// upId)
 {
     this.fehc.Add(o, cf, isFuseMax, pos);
 }