示例#1
0
        public async Task <TradeOrderStatus> GetOrderStatusAsync(RemoteIdContext context)
        {
            var api  = ApiProvider.GetApi(context);
            var body = CreatePoloniexBody(PoloniexBodyType.OrderStatus);

            body.Add("orderNumber", context.RemoteGroupId);

            var r = await api.GetOrderStatusAsync(body).ConfigureAwait(false);

            var status = new TradeOrderStatus();

            //status.Rate
            return(null);
        }
 public void Update(StockWeiTuo wt)
 {
     this.WTnbr       = wt.WTnbr;
     this.Code        = wt.Code;
     this.Name        = wt.Name;
     this.Time        = wt.Time;
     this.Price       = wt.Price;
     this.Qty_deal    = wt.Qty_deal;
     this.WeiTuo_Type = wt.WeiTuo_Type;
     this.Title1      = wt.Title1;
     this.Title2      = wt.Title2;
     this.Status      = wt.Status;
     this.Qty_cancel  = wt.Qty_cancel;
     this.Fee         = wt.Fee;
     this.Price_deal  = wt.Price_deal;
 }
示例#3
0
        private async void WaitForEnd(string tradeId)
        {
            TradeOrderStatus lastStatus = null;
            var finished = false;

            do
            {
                lastStatus = await Provider.GetOrderStatusAsync(new RemoteIdContext(Context.UserContext, tradeId)).ConfigureAwait(false);

                finished = finished || lastStatus.IsClosed;
                if (!finished)
                {
                    Thread.Sleep(1000);
                }
            } while (!finished);

            SetComplete();
        }
示例#4
0
        private void DisplayOrderStatusInfo(TradeOrderStatus tradeOrderStatus, AssetPair market)
        {
            OutputWriter.WriteLine($"Remote trade order id: {tradeOrderStatus.RemoteOrderId}");

            var marketString = tradeOrderStatus.HasMarket ? tradeOrderStatus.Market: market;

            OutputWriter.WriteLine($"{(tradeOrderStatus.IsBuy ? "Buy" : "Sell")} {tradeOrderStatus.AmountInitial ?? Decimal.MinValue} for {tradeOrderStatus.Rate ?? Decimal.MinValue} on '{marketString}' market");

            if (tradeOrderStatus.AmountFilled.HasValue)
            {
                OutputWriter.WriteLine($"Filled amount is {tradeOrderStatus.AmountFilled.Value}");
            }
            if (tradeOrderStatus.AmountRemaining.HasValue)
            {
                OutputWriter.WriteLine($"Remaining amount is {tradeOrderStatus.AmountRemaining.Value}");
            }

            if (tradeOrderStatus.IsOpen)
            {
                OutputWriter.WriteLine("Order is open");
            }

            if (tradeOrderStatus.IsCanceled)
            {
                OutputWriter.WriteLine("Order is canceled");
            }
            if (tradeOrderStatus.IsClosed)
            {
                OutputWriter.WriteLine("Order is closed");
            }

            if (tradeOrderStatus.IsCancelRequested)
            {
                OutputWriter.WriteLine("Order is requested to be canceled");
            }

            OutputWriter.WriteLine("");
        }
示例#5
0
 private void DisplayOrderStatusInfo(TradeOrderStatus tradeOrderStatus)
 {
     DisplayOrderStatusInfo(tradeOrderStatus, AssetPair.Empty);
 }
示例#6
0
 public async Task <TradeMyOrder[]> GetMyOrdersAsync(string sPair, TradeOrderStatus status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     return(Newtonsoft.Json.JsonConvert.DeserializeObject <TradeMyOrder[]>(await _getAsync($"{Properties.Settings.Default.URL}/my/orders/?{(string.IsNullOrEmpty(sPair) ? "" : $"pair={sPair}&")}status={status}", true, cancellationToken)));