예제 #1
0
        void zf_OrderEvent(object sender, ZenFire.OrderEventArgs e)
        {
            ZenFire.IOrder order = e.Order;
            String price, trigger;
            
            try { price = order.Price.ToString(); }
            catch { price = "N/A"; }
            try { trigger = order.TriggerPrice.ToString(); }
            catch { trigger = "N/A"; }

            int reas = (int)order.Reason;
            string[] row = { 
                               Enum.GetName(e.Type.GetType(), e.Type),
                               order.ID.ToString(), 
                               order.Account.ToString(),
                               order.Product.ToString(),
                               Enum.GetName(typeof(ZenFire.Order.Type), order.Type),
                               Enum.GetName(typeof(ZenFire.Order.Status), order.Status),
                      //         Enum.GetName(typeof(ZenFire.Order.Reason), order.Reason),
                               reas.ToString() + " -" + Enum.GetName(typeof(ZenFire.Order.Reason), order.Reason) ,
                               order.Quantity.ToString(),
                               order.QuantityOpen.ToString(),
                               order.QuantityFilled.ToString(),
                               order.QuantityCanceled.ToString(),
                               order.Price.ToString(),
                               order.TriggerPrice.ToString(),
                               order.FillPrice.ToString(),
                               order.ZenTag,
                               order.Tag,
                                
                           };
            ThreadPool.QueueUserWorkItem(new WaitCallback(WorkerMethod), (object)row );
        }
        void zf_PositionDetailsUpdate(object sender, ZenFire.AccountEventArgs e)
        {
            ZenFire.IAccount acct = e.Account;

            string[] row = { acct.ToString(), /*acct.AvgFillPrice,*/ /*acct.Position,*/ acct.OpenPL.ToString(), 
                             /*acct.Symbol,*/ acct.ClosedPL.ToString(), /*acct.LastTrade,*/ /*acct.TotalPL*/ };
            ThreadPool.QueueUserWorkItem(new WaitCallback(WorkerMethod), (object)row);
        }
        public CompletedOrdersEventWindow(ZenFire.Connection z)
        {
            InitializeComponent();
            zf = z;
            insertRow = new InsertRowCallBack(eventGrid.Rows.Insert);

            zf.OrderEvent += new ZenFire.Connection.OrderEventHandler(zf_CompletedOrdersUpdate);
        }
예제 #4
0
        public OrderEventWindow(ZenFire.Connection z)
        {
            InitializeComponent();
            zf = z;
            insertRow = new InsertRowCallback(eventGrid.Rows.Insert);

            zf.OrderEvent += new ZenFire.Connection.OrderEventHandler(zf_OrderEvent);
        }
        public AccountSummaryEventWindow(ZenFire.Connection z)
        {
            InitializeComponent();
            zf = z;
            insertRow = new InsertRowCallback(eventAccountGrid.Rows.Insert);

            zf.AccountEvent += new ZenFire.Connection.AccountEventHandler(zf_AccountUpdate);
        }
예제 #6
0
        public QuoteBoardEventWindow(ZenFire.Connection z)
        {
            InitializeComponent();
            zf = z;
            insertRow = new InsertRowCallBack(eventGrid.Rows.Insert);

            zf.TickEvent += new ZenFire.Connection.TickEventHandler(zf_QuoteBoardUpdate);
        }
        public PositionDetailsEventWindow(ZenFire.Connection z)
        {
            InitializeComponent();
            zf = z;
            insertRow = new InsertRowCallback(eventGrid.Rows.Insert);

            zf.AccountEvent += new ZenFire.Connection.AccountEventHandler(zf_PositionDetailsUpdate);
        }
 void zf_AccountUpdate(object sender, ZenFire.AccountEventArgs e)
 {
     ZenFire.IAccount acct = e.Account;
                                                                       
     string[] row = { acct.ToString(), "0",/*acct.GetPosition().ToString(),*/ acct.OpenPL.ToString(), acct.ClosedPL.ToString(),
                      "0",/*acct.TotalPL,*/ acct.Balance.ToString(), "0" };
     ThreadPool.QueueUserWorkItem(new WaitCallback(WorkerMethod), (object)row);
 }
예제 #9
0
        void zf_OpenOrdersUpdate(object sender, ZenFire.OrderEventArgs e)
        {
            ZenFire.IOrder order = e.Order;

            string[] row = { order.Account.ToString(), /*order.Number,*/ order.Status.ToString(), order.Product.Symbol.ToString(),
                             /*order.Side,*/ order.Type.ToString(), order.Quantity.ToString(), order.QuantityFilled.ToString(),
                            /*order.LimitPrice,*/ /*order.StopPrice,*/ order.FillPrice.ToString(), /*order.Ordertime*/};
            ThreadPool.QueueUserWorkItem(new WaitCallback(WorkerMethod), (object)row);
        }
예제 #10
0
        public AlertEventWindow(ZenFire.Connection z)
        {
            InitializeComponent();
            zf = z;
            timeFmt = "h:mm:ss.fff";

            insertRow = new InsertRowCallback(eventGrid.Rows.Insert);
            zf.AlertEvent += new ZenFire.Connection.AlertEventHandler(zf_AlertEvent);

        }
예제 #11
0
파일: Zfd.cs 프로젝트: bluejack2000/core
        public Zfd(ZenFire.Connection z)
        {
            InitializeComponent();
            zf = z;
            /*
            insertRow = new InsertRowCallback(eventGrid.Rows.Insert);
            zf.Alert += new ZenFire.Connection.AlertEventHandler(zf_Alert);
             */

            accountListBox.Items.AddRange(zf.ListAccounts());
        }
예제 #12
0
        /*
        protected override void Finalize()
        {
            try
            {
                zf.TickEvent -= Z
        */
        void zf_TickEvent(object sender, ZenFire.TickEventArgs e)
        {

            string[] row = {
                               e.TimeStamp.ToString(timeFmt),
                               Enum.GetName(typeof(ZenFire.TickType), e.Type),
                               e.Product.ToString(),
                               e.Price.ToString(),
                               e.Volume.ToString(),
                               Enum.GetName(typeof(ZenFire.TickFlags), e.Flags)
                           };
            ThreadPool.QueueUserWorkItem(new WaitCallback(WorkerMethod), (object)row);
        }
예제 #13
0
        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);
        }
예제 #14
0
        public TickEventWindow(ZenFire.Connection z)
        {
            InitializeComponent();
            zf = z;
            timeFmt = "h:mm:ss.fff";
            insertRow = new InsertRowCallback(eventGrid.Rows.Insert);

            exchangeComboBox.DisplayMember = "Text";
            exchangeComboBox.ValueMember = "ID";
            exchangeComboBox.DataSource = zf.ListExchanges();

            tick = new ZenFire.Connection.TickEventHandler(zf_TickEvent);
            zf.TickEvent += tick;// new ZenFire.Connection.TickEventHandler(zf_TickEvent);
        }
예제 #15
0
        public PlaceOrderWindow(ZenFire.Connection z)
        {
            InitializeComponent();
            zf = z;

            Bind.List(accountComboBox, zf.ListAccounts());
            Bind.List(actionComboBox, Bind.FromEnum(ZenFire.Order.Action.Buy));
            Bind.List(durationComboBox, Bind.FromEnum(ZenFire.Order.Duration.Day));
            Bind.List(typeComboBox, Bind.FromEnum(ZenFire.Order.Type.Market));

            exchangeComboBox.DisplayMember = "Text";
            exchangeComboBox.ValueMember = "ID";
            exchangeComboBox.DataSource = zf.ListExchanges();
        }
예제 #16
0
 void zf_AccountUpdate(object sender, ZenFire.AccountEventArgs e)
 {
     ZenFire.IAccount acct = e.Account;
     string[] row = { acct.ToString(), acct.Balance.ToString(), acct.Margin.ToString(), acct.OpenPL.ToString(), acct.ClosedPL.ToString() };
     this.Invoke(insertRow, new object[] { 0, row });
 }
예제 #17
0
파일: Login.cs 프로젝트: bluejack2000/core
 public Login(ZenFire.Connection z)
 {
     zf = z;
     InitializeComponent();
     Bind.List(env, zf.ListEnvironments());
 }
예제 #18
0
 void zf_PositionUpdate(object sender, ZenFire.PositionEventArgs e)
 {
     ZenFire.IPosition pos = e.Position;
     string[] row = { pos.Account.ToString(), pos.Product.ToString(), pos.Size.ToString(), pos.OpenPL.ToString(), pos.ClosedPL.ToString()};
     ThreadPool.QueueUserWorkItem(new WaitCallback(WorkerMethod), (object)row);
 }
예제 #19
0
 void zf_AccountUpdate(object sender, ZenFire.AccountEventArgs e)
 {
     ZenFire.IAccount acct = e.Account;
     string[] row = { acct.ToString(), acct.Balance.ToString(), acct.Margin.ToString(), acct.OpenPL.ToString(), acct.ClosedPL.ToString() };
     ThreadPool.QueueUserWorkItem(new WaitCallback(WorkerMethod), (object)row);
 }
예제 #20
0
 void zf_AlertEvent(object sender, ZenFire.AlertEventArgs e)
 {
     ZenFire.AlertType alert = e.Type;
     string[] row = { DateTime.Now.ToString(timeFmt), alert.ToString() };
     ThreadPool.QueueUserWorkItem(new WaitCallback(WorkerMethod), (object)row);
 }