Exemple #1
0
        public void PostOrder(AutoCutOrder order)
        {
            var daltonOrder = new DaltonOrder
            {
                AccountPk  = order.AccountPk,
                FDCNID     = order.FDCNID,
                ClearingID = order.ClearingID,
                BatchID    = order.BatchID,
                ClientTag  = order.ClientTag,

                Legs = new List <Leg> {
                    new Leg
                    {
                        Quantity = order.PositionQuantity,
                        Symbol   = order.Symbol,
                    }
                }
            };
            var json = JsonConvert.SerializeObject(daltonOrder);

            WebClient client = new WebClient();

            client.Headers.Add("authorization", "d2lzaElIYWREaXJlY3RDb25uZWN0");
            client.Headers.Add("content-type", "application/json");


            var response = client.UploadString(_dalton, json);

            //**********Echo response for dev purpose************
            //Console.WriteLine(json);
            //Console.WriteLine(response);
            //***************************************************
            SetOrderSent(order);
        }
Exemple #2
0
        public void SetOrderSkipped(AutoCutOrder order)
        {
            var query =
                @"UPDATE AutoCutOrders
              SET OrderState='SKIPPED'
              WHERE AutoCutOrdersID=@AutoCutOrdersID";

            _temporaryDB.Execute(query, order);
        }
Exemple #3
0
 private void ProcessOrder(AutoCutOrder order)
 {
     if (order.SkipPosition)
     {
         SetOrderSkipped(order);
     }
     else
     {
         PostOrder(order);
     }
 }
Exemple #4
0
        public void SetOrderSent(AutoCutOrder order)
        {
            var query =
                @"UPDATE AutoCutOrders
              SET TimeSent=getutcdate(), 
                  OrderSent=1, 
                  ClientTag=@ClientTag,
                  OrderState='SENT'
              WHERE AutoCutOrdersID=@AutoCutOrdersID";

            _temporaryDB.Execute(query, order);
        }