Beispiel #1
0
        private void UpdateBalances(List <string> marketFilter)
        {
            if (requestBalancesStart)
            {
                return;
            }
            if (marketFilter.Count == 0)
            {
                return;
            }
            requestBalancesStart    = true;
            marketBalance           = new Dictionary <string, List <Balance> >();
            dgridBalance.DataSource = null;

            foreach (var itemMarket in marketFilter)
            {
                RequestItemGroup     itemgroup     = new RequestItemGroup(UpdateBalances_UIResultHandler);
                Market               market        = ExchangeManager.GetMarketByMarketName(itemMarket);
                TradeRequestHandlers tradeHandlers = new TradeRequestHandlers(market);
                itemgroup.AddItem(market.GetBalancesBegin(), tradeHandlers.GetBalances_RequestHandler);
                RequestConsumer.requestManager.AddItemGroup(market.MarketName(), itemgroup);
            }

            /*
             * foreach (var itemMarket in marketFilter)
             * {
             *  RequestItemGroup igroup = new RequestItemGroup(UpdateBala_UIRndler);
             *  Market imarket = ExchangeManager.GetMarketByMarketName("Bittrex");
             *  TradeRequestHandlers itradeHandlers = new TradeRequestHandlers(imarket);
             *  igroup.AddItem(imarket.GetBalan(), itradeHandlers.GetBala);
             *  RequestConsumer.requestManager.AddItemGroup(imarket.MarketName(), igroup);
             * }
             */
        }
Beispiel #2
0
        private void LoadTickers()
        {
            //toolDropDownTickerBtc.DropDown.Items.Clear();
            //toolDropDownTickerUsdt.DropDown.Items.Clear();
            //toolDropDownTickerBtc.Enabled = false;
            //toolDropDownTickerUsdt.Enabled = false;
            toolButtonTickerBtc.Enabled     = false;
            toolButtonTickerUsd.Enabled     = false;
            toolStripButtonChart.Enabled    = false;
            toolStripButtonAlerts.Enabled   = false;
            toolStripComboBoxMarket.Enabled = false;
            toolStripButtonBalance.Enabled  = false;

            // if (!ExchangeManager.GetMarketByMarketName(toolStripComboBoxMarket.Text).HaveKey())
            //     return;

            Market market = ExchangeManager.GetMarketByMarketName(toolStripComboBoxMarket.Text);

            tradeHandlers = new TradeRequestHandlers(market);

            /*
             * RequestItemGroup itemgroup = new RequestItemGroup(LoadTickers_UIResultHandler);
             * itemgroup.AddItem(market.GetTradePairsBegin(), tradeHandlers.GetTradePairs_RequestHandler);
             * RequestConsumer.requestManager.AddItemGroup(market.MarketName(), itemgroup);
             */

            UpdateMarkets();
        }
Beispiel #3
0
 public FormTradeLogic(string ticker_, Market market_)
 {
     ticker              = ticker_;
     tickerinfo          = new Pair(ticker);
     baseCurrencyName    = tickerinfo.currency1;
     counterCurrencyName = tickerinfo.currency2;
     market              = market_;
     tradeHandlers       = new TradeRequestHandlers(market);
 }
Beispiel #4
0
        private void UpdateMarket(string marketName)
        {
            Market market = ExchangeManager.GetMarketByMarketName(marketName);

            tradeHandlers = new TradeRequestHandlers(market);
            RequestItemGroup itemgroup = new RequestItemGroup(GetMarketCurrent_UIResultHandler);

            itemgroup.AddItem(market.GetMarketCurrentBegin(), tradeHandlers.GetMarketCurrent_RequestHandler);
            RequestConsumer.requestManager.AddItemGroup(market.MarketName(), itemgroup);
        }