Exemple #1
0
 internal bool SendClearingOrder(string time, uint number)
 {
     if (SellOrder.ContainsValue(number) && SellOrder.Remove(SellOrder.First(o => o.Value == number).Key) && Residue.Remove(number))
     {
         if (verify)
         {
             statement.Enqueue(new Conclusion
             {
                 Time        = ConvertDateTime(time),
                 Division    = string.Concat(sell, cancel),
                 Price       = string.Empty,
                 OrderNumber = number.ToString("N0")
             });
         }
         return(true);
     }
     if (BuyOrder.ContainsValue(number) && BuyOrder.Remove(BuyOrder.First(o => o.Value == number).Key) && Residue.Remove(number))
     {
         if (verify)
         {
             statement.Enqueue(new Conclusion
             {
                 Time        = ConvertDateTime(time),
                 Division    = string.Concat(buy, cancel),
                 Price       = string.Empty,
                 OrderNumber = number.ToString("N0")
             });
         }
         return(true);
     }
     return(false);
 }
Exemple #2
0
        internal bool SendCorrectionOrder(string time, string price, uint number, int residue)
        {
            if (SellOrder.ContainsValue(number) && SellOrder.Remove(SellOrder.First(o => o.Value == number).Key) && Residue.Remove(number))
            {
                SellOrder[price] = Count;
                Residue[Count++] = residue;

                if (verify)
                {
                    statement.Enqueue(new Conclusion
                    {
                        Time        = ConvertDateTime(time),
                        Division    = string.Concat(sell, correction),
                        Price       = price,
                        OrderNumber = SellOrder[price].ToString("N0")
                    });
                }
                return(true);
            }
            if (BuyOrder.ContainsValue(number) && BuyOrder.Remove(BuyOrder.First(o => o.Value == number).Key) && Residue.Remove(number))
            {
                BuyOrder[price]  = Count;
                Residue[Count++] = residue;

                if (verify)
                {
                    statement.Enqueue(new Conclusion
                    {
                        Time        = ConvertDateTime(time),
                        Division    = string.Concat(buy, correction),
                        Price       = price,
                        OrderNumber = BuyOrder[price].ToString("N0")
                    });
                }
                return(true);
            }
            return(false);
        }