コード例 #1
0
        void GetBalances()
        {
            var ai = m_exch.GetAccountInfo();

            cout("BINANCE commissions:   buyer={0}  seller={1}  maker={2}  taker={3}", ai.BuyerCommission, ai.SellerCommission, ai.MakerCommission, ai.TakerCommission);
            cout("BINANCE abilities:   can_deposit={0}  can_trade={1}  can_withdraw={2}", ai.CanDeposit, ai.CanTrade, ai.CanWithdraw);
            var bals = ai.Balances;

            cout("BINANCE BALANCES (showing non-zero only):");
            foreach (var b in bals)
            {
                if (b.Free != 0 || b.Locked != 0)
                {
                    cout("Binance:{0}> free:{1} locked:{2}", b.Currency, b.Free, b.Locked);
                }
            }

            /*var dh = m_exch.GetDepositHistory(m_pair);
             * cout("BINANCE DEPOSIT HISTORY:");
             * foreach (var d in dh.DepositList)
             * {
             *  cout("{0}> {1}  {2}  {3}", d.Asset, d.Amount, d.InsertTime, d.Status);
             * }
             *
             * var wh = m_exch.GetWithdrawHistory(m_pair);
             * cout("BINANCE WITHDRAW HISTORY:");
             * foreach (var w in wh.WithdrawList)
             * {
             *  cout("{0}> {1}  {2}  {3}", w.Asset, w.Amount, w.InsertTime, w.Status);
             * }*/



            // ACCOUNT AND TRADE BALANCES

            /*var abal = m_exch.GetAccountBalance();
             * if (abal != null)
             * {
             *  foreach (var s in abal.Keys)
             *  {
             *      cout("---acct balance {0}: {1}", s, abal[s]);
             *  }
             * }
             * var tbal = m_exch.GetTradeBalance();
             * if (tbal != null)
             * {
             *  cout("---" + tbal.ToString());
             * }*/
            //cout("\n");
        }