public Home() { InitializeComponent(); ac = new ApiConnect(); ApiSettings saved = ac.readSettings(); if (saved.OrganizationID != null) { ac.setup(saved); if (saved.Enviorment == 1) { currency = "BTC"; } ac.currency = currency; refreshBalance(); refreshOrders(false); ac.getPools(true); timer = new System.Threading.Timer( e => runBot(), null, TimeSpan.Zero, TimeSpan.FromSeconds(60)); } }
private void loadPools(bool force) { if (ac.connected) { pools = ac.getPools(force); dataGridView1.DataSource = pools; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None; dataGridView1.AllowUserToOrderColumns = true; dataGridView1.AllowUserToResizeColumns = true; } }
private void comboAlgorithm_SelectedIndexChanged(object sender, EventArgs e) { //get algo settings foreach (JObject obj in ac.algorithms) { if (this.comboAlgorithm.SelectedItem.Equals(obj["algorithm"])) { this.algo = obj; } } //set lbls this.priceLbl.Text = ac.currency + "/" + this.algo["displayMarketFactor"] + "/day"; this.limitLbl.Text = this.algo["displayMarketFactor"] + "/second"; this.priceDetailsLbl.Text = "> 0"; this.limitDetailsLbl.Text = "> " + this.algo["minSpeedLimit"] + " AND < " + this.algo["maxSpeedLimit"] + " OR 0 // no speed limit"; this.amountDetailsLbl.Text = "> " + this.algo["minimalOrderAmount"]; this.tbLimit.Text = "" + this.algo["minSpeedLimit"]; this.tbAmount.Text = "" + this.algo["minimalOrderAmount"]; //filter pools this.comboPools.Items.Clear(); this.comboPools.ResetText(); this.comboPools.SelectedIndex = -1; foreach (JObject pool in ac.getPools(false)) { if (this.comboAlgorithm.SelectedItem.Equals(pool["algorithm"])) { this.comboPools.Items.Add(pool); } } if (!edit) { formDataUpdate(); } }