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); }
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); }
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); }
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); }
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); }
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()); }
/* 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); }
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); }
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); }
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(); }
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 }); }
public Login(ZenFire.Connection z) { zf = z; InitializeComponent(); Bind.List(env, zf.ListEnvironments()); }
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); }
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); }
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); }