private void bbSyncWithLowestAsk_ItemClick(object sender, ItemClickEventArgs e)
        {
            SelectedCollection = (TickerCollection)this.bbTryArbitrage.Tag;
            if (SelectedCollection == null)
            {
                return;
            }
            Ticker lowest  = SelectedCollection.Arbitrage.LowestAskTicker;
            Ticker highest = SelectedCollection.Arbitrage.HighestBidTicker;

            if (!lowest.UpdateBalance(lowest.BaseCurrency))
            {
                LogManager.Default.Error("Cant update balance.", lowest.HostName + "-" + lowest.BaseCurrency);
                SelectedCollection = null;
                LogManager.Default.ShowLogForm();
                return;
            }
            if (!highest.UpdateBalance(highest.BaseCurrency))
            {
                LogManager.Default.Error("Cant update balance.", highest.HostName + "-" + highest.BaseCurrency);
                SelectedCollection = null;
                LogManager.Default.ShowLogForm();
                return;
            }

            string lowAddress = lowest.GetDepositAddress(lowest.BaseCurrency);

            if (string.IsNullOrEmpty(lowAddress))
            {
                LogManager.Default.Error("Cant get deposit address.", lowest.HostName + "-" + lowest.BaseCurrency);
                SelectedCollection = null;
                LogManager.Default.ShowLogForm();
                return;
            }

            string highAddress = highest.GetDepositAddress(highest.BaseCurrency);

            if (string.IsNullOrEmpty(highAddress))
            {
                LogManager.Default.Error("Cant get deposit address.", highest.HostName + "-" + highest.BaseCurrency);
                SelectedCollection = null;
                LogManager.Default.ShowLogForm();
                return;
            }

            LogManager.Default.Log("Lowest Ask Base Currency Deposit: " + lowAddress);
            LogManager.Default.Log("Highest Bid Base Currency Deposit: " + highAddress);

            double amount = highest.BaseCurrencyBalance;

            LogManager.Default.Log("Highest Bid Base Currency Amount = " + amount.ToString("0.00000000"));

            highest.Withdraw(highest.BaseCurrency, lowAddress, "", amount);

            LogManager.Default.ShowLogForm();
            SelectedCollection = null;
        }
        protected virtual bool SyncToHighestBid(TickerCollection info, bool forceUpdateBalance, bool allowLog)
        {
            if (info == null)
            {
                return(false);
            }

            Ticker lowest  = info.Arbitrage.LowestAskTicker;
            Ticker highest = info.Arbitrage.HighestBidTicker;

            if (forceUpdateBalance || lowest.MarketCurrencyBalance == 0)
            {
                if (!lowest.UpdateBalance(lowest.MarketCurrency))
                {
                    if (allowLog)
                    {
                        LogManager.Default.Error("Cant update balance.", lowest.HostName + "-" + lowest.MarketCurrency);
                    }
                    if (allowLog)
                    {
                        LogManager.Default.ShowLogForm();
                    }
                    return(false);
                }
                if (!highest.UpdateBalance(highest.MarketCurrency))
                {
                    if (allowLog)
                    {
                        LogManager.Default.Error("Cant update balance.", highest.HostName + "-" + highest.MarketCurrency);
                    }
                    if (allowLog)
                    {
                        LogManager.Default.ShowLogForm();
                    }
                    return(false);
                }
            }
            string highAddress = highest.GetDepositAddress(highest.MarketCurrency);

            if (string.IsNullOrEmpty(highAddress))
            {
                if (allowLog)
                {
                    LogManager.Default.Error("Cant get deposit address.", highest.HostName + "-" + highest.MarketCurrency);
                }
                if (allowLog)
                {
                    LogManager.Default.ShowLogForm();
                }
                return(false);
            }

            if (allowLog)
            {
                LogManager.Default.Log("Highest Bid Currency Deposit: " + highAddress);
            }

            double amount = lowest.MarketCurrencyBalance;

            if (allowLog)
            {
                LogManager.Default.Log("Lowest Ask Currency Amount = " + amount.ToString("0.00000000"));
            }

            if (lowest.Withdraw(lowest.MarketCurrency, highAddress, "", amount))
            {
                string text = "Withdraw " + lowest.MarketCurrency + " " + lowest.HostName + " -> " + highest.HostName + " succeded.";
                if (allowLog)
                {
                    LogManager.Default.Success(text);
                }
                TelegramBot.Default.SendNotification(text);
                return(true);
            }
            else
            {
                if (allowLog)
                {
                    LogManager.Default.Error("Withdraw " + lowest.MarketCurrency + " " + lowest.HostName + " -> " + highest.HostName + " failed.");
                }
                return(false);
            }
        }