Exemple #1
0
        public Search(balance uBalance, mainForm mF)
        {
            mForm = mF;

            InitializeComponent();
            try
            {
                WebClient client = new WebClient();
                client.Encoding = Encoding.UTF8;

                var reply = client.DownloadString("https://api.upbit.com/v1/market/all");

                DataTable dataTable = (DataTable)JsonConvert.DeserializeObject(reply, (typeof(DataTable)));

                for (int i = dataTable.Rows.Count - 1; i >= 0; i--) //KRW 빼고 모두 삭제
                {
                    DataRow dr = dataTable.Rows[i];
                    if (!dr["market"].ToString().Contains("KRW"))
                    {
                        dr.Delete();
                    }
                }

                dataTable.AcceptChanges();


                dgvCoin.DataSource = dataTable;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Exemple #2
0
 public Request(string mPrice, balance uBalance)
 {
     userBalance = uBalance;
     marketPrice = mPrice;
     InitializeComponent();
     cmbRequest.Items.Add("매수");
     cmbRequest.Items.Add("매도");
 }
Exemple #3
0
        public Request(string code, string coinName, string mPrice, balance uBalance, mainForm mF)
        {
            InitializeComponent();
            cmbRequest.Items.Add("매수");
            cmbRequest.Items.Add("매도");
            userBalance   = uBalance;
            marketPrice   = mPrice;
            this.coinName = coinName;
            this.code     = code;
            mForm         = mF;

            order_control = new Thread(new ThreadStart(Order_Control));
            order_control.Start();
        }
Exemple #4
0
        private void btnReset_Click(object sender, EventArgs e)
        {
            // 잔고 초기화
            userBalance = new balance();
            long totalAsset        = userBalance.getTotalAsset();
            long cash              = userBalance.getCash();
            long profit            = userBalance.getProfit();
            long purchase          = userBalance.getPurchaseAmount();
            long currentTotalPrice = userBalance.getCurrentTotalPrice();

            lblBalance.Text        = totalAsset.ToString();
            lbl_percent.Text       = "0%";
            profit_txt.Text        = profit.ToString();
            lblPurchaseNumber.Text = purchase.ToString();
            evaluated_txt.Text     = currentTotalPrice.ToString();
            cash_txt.Text          = cash.ToString();
        }
Exemple #5
0
        private void btnReset_Click(object sender, EventArgs e)
        {
            // 잔고 초기화
            userBalance = new balance();
            double totalAsset        = userBalance.getTotalAsset();
            double cash              = userBalance.getCash();
            double profitPercent     = userBalance.calcProfitPercentage();
            double profit            = userBalance.getProfit();
            double purchase          = userBalance.getPurchaseAmount();
            double currentTotalPrice = userBalance.getCurrentTotalPrice();

            lblBalance.Text    = totalAsset.ToString();
            lbl_percent.Text   = "0%";
            profit_txt.Text    = profit.ToString();
            purchase_txt.Text  = purchase.ToString();
            evaluated_txt.Text = currentTotalPrice.ToString();
            cash_txt.Text      = cash.ToString();
        }
Exemple #6
0
        public mainForm()
        {
            InitializeComponent();
            userBalance = new balance();
            double totalAsset        = userBalance.getTotalAsset();
            double cash              = userBalance.getCash();
            double profitPercent     = userBalance.calcProfitPercentage();
            double profit            = userBalance.getProfit();
            double purchase          = userBalance.getPurchaseAmount();
            double currentTotalPrice = userBalance.getCurrentTotalPrice();

            lblBalance.Text    = totalAsset.ToString();
            lbl_percent.Text   = "0%";
            profit_txt.Text    = profit.ToString();
            purchase_txt.Text  = purchase.ToString();
            evaluated_txt.Text = currentTotalPrice.ToString();
            cash_txt.Text      = cash.ToString();
        }
Exemple #7
0
        public mainForm()
        {
            InitializeComponent();
            userBalance = new balance();
            buy_data    = new buyData();
            sell_data   = new sellData();

            long   totalAsset        = userBalance.getTotalAsset();
            long   cash              = userBalance.getCash();
            double profitPercent     = userBalance.getProfitPercentage();
            long   profit            = userBalance.getProfit();
            long   purchase          = userBalance.getPurchaseAmount();
            long   currentTotalPrice = userBalance.getCurrentTotalPrice();

            lblBalance.Text        = totalAsset.ToString();
            lbl_percent.Text       = "0%";
            profit_txt.Text        = profit.ToString();
            lblPurchaseNumber.Text = purchase.ToString();
            evaluated_txt.Text     = currentTotalPrice.ToString();
            cash_txt.Text          = cash.ToString();
        }