예제 #1
0
        private async void toggleMarket()
        {
            orderBookGB.Text = string.Concat("ORDER BOOK (", marketCB.Text, ")".ToUpper());

            if (buysellButton.Text == "Sell")
            {
                tradeGB.Text            = string.Concat("Buy (", marketCB.Text, ")".ToUpper());
                executeOrderButton.Text = "Execute Buy".ToUpper();
            }
            else
            {
                tradeGB.Text            = string.Concat("Sell (", marketCB.Text, ")".ToUpper());
                executeOrderButton.Text = "Execute Sell".ToUpper();
            }

            getActiveOrders();
            getBalance();

            TickerPrice.CryptoAPI results = await TickerPrice.TickerGetPrice(marketCB.Text);

            tickerInfoResults = await TickerPrice.TickerGetInfo(marketCB.Text);

            quantityGB.Text = string.Concat("QUANTITY (min ", tickerInfoResults.min_order_size, ")");
            priceLabel.Text = marketCB.Text.Substring(marketCB.Text.Length - 3, 3).ToUpper();
            fiatLabel.Text  = marketCB.Text.Substring(marketCB.Text.Length - 3, 3).ToUpper();
            coinLabel.Text  = marketCB.Text.Substring(0, marketCB.Text.Length - 3).ToUpper();
            priceTB.Text    = results.ask.ToString();
        }
예제 #2
0
        private async void getOrderBook()
        {
            TickerPrice.CryptoAPI3 orderBookData = await TickerPrice.orderBooks(marketCB.Text);

            if (orderBookData == null || orderBookData.asks == null || orderBookData.bids == null)
            {
                return;
            }

            double cumulative = 0;
            int    count      = 0;

            askOBLV.BeginUpdate();
            bidOBLV.BeginUpdate();

            askOBLV.Items.Clear();

            foreach (TickerPrice.CryptoAPI3A data in orderBookData.asks)
            {
                if (count > 20)
                {
                    break;
                }
                count++;

                cumulative = cumulative + data.amount;

                ListViewItem listViewItem = new ListViewItem(data.price.ToString());
                listViewItem.SubItems.Add(data.amount.ToString());
                listViewItem.SubItems.Add(cumulative.ToString("F8"));
                askOBLV.Items.Add(listViewItem);
            }

            cumulative = 0;
            count      = 0;
            bidOBLV.Items.Clear();

            foreach (TickerPrice.CryptoAPI3A data in orderBookData.bids)
            {
                if (count > 20)
                {
                    break;
                }
                count++;

                cumulative = cumulative + data.amount;

                ListViewItem listViewItem = new ListViewItem(data.price.ToString());
                listViewItem.SubItems.Add(data.amount.ToString());
                listViewItem.SubItems.Add(cumulative.ToString("F8"));
                bidOBLV.Items.Add(listViewItem);
            }

            askOBLV.EndUpdate();
            bidOBLV.EndUpdate();
        }
예제 #3
0
        private async void getSymbols()
        {
            string symbols = await TickerPrice.getSymbols();

            symbols = symbols.Replace("[\"", "");
            symbols = symbols.Replace("\"]", "");
            symbols = symbols.Replace("\"", "");

            foreach (string str in symbols.Split(","))
            {
                marketCB.Items.Add(str.ToUpper());
            }
        }