public StopOrder(StopOrder order) { OrderId = order.OrderId; this.Amount = order.Amount; this.Currency = order.Currency; this.ExecuteTime = order.ExecuteTime; this.OrderTime = order.OrderTime; this.Price = order.Price; this.Status = order.Status; this.Type = order.Type; }
private void btnSell_Click(object sender, EventArgs e) { double price = 0; double amount = 0; try { amount = Double.Parse(this.txtSellCount.Text.Trim()); price = Double.Parse(this.txtSellPrice.Text.Trim()); if (this.comboSellType.SelectedIndex == 0) { } else { if (this.comboSellType.SelectedIndex == 1) { currentTicker = mtgoxV0.ticker(); price = currentTicker.buy - Consts.MarketTol; } else if (this.comboSellType.SelectedIndex == 2) { StopOrder stopOrder = new StopOrder(); stopOrder.Amount = amount; stopOrder.Currency = Currency; stopOrder.OrderTime = System.DateTime.Now; stopOrder.Price = price; stopOrder.Status = StopOrder.OrderStatus.Pending; stopOrder.Type = StopOrder.OrderType.SellStop; this.stopOrderList.Add(stopOrder); Utils.SaveToFile(this.stopOrderList, this.stopOrderFullPath); return; } } } catch { MessageBox.Show(ResourceFactory.GetString("InputError"), ResourceFactory.GetString("InputError"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } List<MtGoxOrder> order = mtgoxV0.sellBTC(amount, Currency, price); if (order != null) { MessageBox.Show(ResourceFactory.GetString("OrderSucceed"), ResourceFactory.GetString("OrderSucceed"), MessageBoxButtons.OK); } }
public SellStopOrder(StopOrder order) : base(order) { }