public void OrderBookRefresh() { var trading = new TradingController(); gridOrdersBook.DataSource = trading.GetAllOpenOrders(); //gridOrdersBook.Columns.Add(new DataGridViewColumn() { Name = "test"}); }
private void btnClearOrder_Click(object sender, EventArgs e) { TradingController tc = new TradingController(); var orders = tc.GetAllOpenOrders(); var currencyPair = new CurrencyPair(listMarket.SelectedItem.ToString(), cbCurrencyAchat.SelectedItem.ToString()); foreach (var item in orders) { if (item.CurrencyPair == currencyPair) { tc.DeleteOrder(currencyPair, item.IdOrder); Reinitialisation(); } } }
IHttpController IHttpControllerActivator.Create( HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType) { if (controllerType == typeof(TradingController)) { var tradingCtrl = new TradingController(); var sub = tradingCtrl.Subscribe(requestObserver); request.RegisterForDispose(sub); return(tradingCtrl); } if (controllerType == typeof(PredictionController)) { return(new PredictionController()); } throw new ArgumentException( $"Unknown controller type requested: {controllerType}", nameof(controllerType)); }
private void btnAcheter_Click(object sender, EventArgs e) { if (txtPrixAchat.Text != string.Empty && txtUSDTAchat.Text != string.Empty) { var tradingController = new TradingController(); double price = Convert.ToDouble(txtPrixAchat.Text); double amount = Convert.ToDouble(txtAmountAchat.Text); double usdt = Math.Floor(Convert.ToDouble(txtUSDTAchat.Text)); var currencyPair = cbCurrencyAchat.SelectedItem.ToString(); var id = tradingController.PostOrder(new CurrencyPair(currencyPair), OrderType.Buy, price, amount); Reinitialisation(); } else { MessageBox.Show("Make sure the price or USDT value is not empty "); } }