Example #1
0
 public void HandleDeal(SpotDeal sd)
 {
     this.NewestDealPrice = sd.Price;
     Deals.Put(sd);
     e24.Put(sd.Price);
     c24.Put(sd.Count);
 }
Example #2
0
        public void Put(SpotDeal sd)
        {
            var dc = Items.Count;

            if (dc > max)
            {
                int c = dc - max;
                lock (loc)
                {
                    Items.RemoveRange(0, c);
                }
            }
            Items.Add(sd);
        }
Example #3
0
        void RaiseDeal(SpotOrder main, SpotOrder slave)
        {
            SpotDeal sd = new SpotDeal
            {
                Id             = IdService <SpotDeal> .Instance.NewId(),
                When           = DateTime.Now,
                Count          = main.DoneCount,
                Price          = main.DonePrice,
                MainId         = main.Id,
                SlaveId        = slave.Id,
                MainTraderName = main.Trader.Name,
                SlaveTraderId  = slave.Trader.Name,
                Coin           = main.Coin,
                CoinId         = main.CoinId,
                MainOrderDir   = main.Direction
            };

            if (OnDeal != null)
            {
                OnDeal(sd);
            }
        }
Example #4
0
 void match_OnDeal(SpotDeal obj)
 {
     Market.Get(obj.Coin).HandleDeal(obj);
     model.SaveDeal(obj);
     ohlcGen.Handle(obj);
 }
Example #5
0
 public void SaveDeal(SpotDeal sd)
 {
     sds.Save(sd);
 }