Пример #1
0
        private void sendButton_Click(object sender, EventArgs e)
        {
            try
            {
                product = zf.GetProduct(productTextBox.Text, exchangeComboBox.SelectedItem.ToString());
            }
            catch
            {
                MessageBox.Show("Invalid product " + productTextBox.Text + "." + exchangeComboBox.SelectedItem.ToString());
            }

            ZenFire.OrderArgs args = new ZenFire.OrderArgs();

            args.Account = (ZenFire.IAccount)accountComboBox.SelectedValue;
            args.Product = product;
            args.Action = (ZenFire.Order.Action)actionComboBox.SelectedValue;
            args.Quantity = Decimal.ToInt32(quantitySpinner.Value);
            args.Duration = (ZenFire.Order.Duration)durationComboBox.SelectedValue;
            args.Type = (ZenFire.Order.Type)typeComboBox.SelectedValue;

            try
            {
                zf.PlaceOrder(args);
            }
            catch
            {
                MessageBox.Show("Failed to send order");
            }
        }
Пример #2
0
        private void sendButton_Click(object sender, EventArgs e)
        {
            try
            {
                product = zf.GetProduct(productTextBox.Text, exchangeComboBox.SelectedItem.ToString());
            }
            catch
            {
                MessageBox.Show("Invalid product " + productTextBox.Text + "." + exchangeComboBox.SelectedItem.ToString());
            }

            ZenFire.OrderArgs args = new ZenFire.OrderArgs();

            args.Account  = (ZenFire.IAccount)accountComboBox.SelectedValue;
            args.Product  = product;
            args.Action   = (ZenFire.Order.Action)actionComboBox.SelectedValue;
            args.Quantity = Decimal.ToInt32(quantitySpinner.Value);
            args.Duration = (ZenFire.Order.Duration)durationComboBox.SelectedValue;
            args.Type     = (ZenFire.Order.Type)typeComboBox.SelectedValue;

            try
            {
                zf.PlaceOrder(args);
            }
            catch
            {
                MessageBox.Show("Failed to send order");
            }
        }
Пример #3
0
 private void type_Changed(object sender, EventArgs e)
 {
     try
     {
         product = zf.GetProduct(productTextBox.Text, exchangeComboBox.SelectedItem.ToString());
     }
     catch
     { MessageBox.Show("Invalid product " + productTextBox.Text + "." + exchangeComboBox.SelectedItem.ToString()); }
 }
Пример #4
0
        private void type_Changed(object sender, EventArgs e)
        {
            try
            {
                product = zf.GetProduct(productTextBox.Text, exchangeComboBox.SelectedItem.ToString());
            }
            catch
            { MessageBox.Show("Invalid product " + productTextBox.Text + "." + exchangeComboBox.SelectedItem.ToString()); }

        }
 void zf_QuoteBoardUpdate(object sender, ZenFire.TickEventArgs e)
 {
     switch (e.Type.ToString())
     {
     case "BestBid":
         //e.Product.
         break;
     }
     ZenFire.IProduct product = zf.GetProduct(productTextBox.Text, "CME");
     string[]         row     = { e.Product.Symbol, };
     ThreadPool.QueueUserWorkItem(new WaitCallback(WorkerMethod), (object)row);
 }
 private void addButton_Click(object sender, EventArgs e)
 {
     try
     {
         ZenFire.IProduct product = zf.GetProduct(productTextBox.Text, "CME");
         zf.Subscribe(product);
         zf.ReplayTicks(product, new DateTime(2009, 9, 24, 15, 00, 00));
     }
     catch (System.Exception x)
     {
         MessageBox.Show("Error subscribing " + x.Message);
     }
 }