public void stop() { if (isRunning && orderLevels.Count > 0) //Make sure there are orders { isStopped = true; SterlingLib.ISTIOrderMaint orderMaint = new SterlingLib.STIOrderMaint(); foreach (OrderLevel level in orderLevels) //Cancel all sitting orders { orderMaint.CancelOrder(level.sittingOrder.Account, 0, level.sittingOrder.ClOrderID, Guid.NewGuid().ToString()); } } else { MessageBox.Show("No scale trade running."); } }
private void button1_Click(object sender, EventArgs e) { if (isRunning) { SterlingLib.ISTIOrderMaint orderMaint = new SterlingLib.STIOrderMaint(); //Cancerl current orders foreach (SterlingLib.ISTIOrder order in currentOrders) //Cancel all sitting orders { orderMaint.CancelOrder(order.Account, 0, order.ClOrderID, Guid.NewGuid().ToString()); } startButton.Enabled = true; button1.Enabled = false; //textBox5.Text = "Stopped"; } else { MessageBox.Show("No scale trade currently running."); } }