private Task Send(QueueClient queueClient, IBroadcastMessage message) { var broadcastMessageAsJson = JsonConvert.SerializeObject(message); var queueMessage = new Message(Encoding.UTF8.GetBytes(broadcastMessageAsJson)); return(queueClient.SendAsync(queueMessage)); }
public Task Message(IBroadcastMessage message) { using (var p = new Packet(SendPacketOperations.BroadcastMsg)) { message.Encode(p); return(SendPacket(p)); } }
private void ReceiveMessageBBO_Options(IBroadcastMessage message, SeriesList.SeriesInformation realtimeSeriesInfo) { try { string messageType = message.MessageType; if (messageType != null) { if (!(messageType == "TP")) { if (messageType == "LS") { if (realtimeSeriesInfo != null) { int num = this.intzaOption.FindIndex("strike", realtimeSeriesInfo.StrikPrice.ToString().Replace(".000000", "")); if (num > -1) { LSMessageTFEX lSMessageTFEX = (LSMessageTFEX)message; if (realtimeSeriesInfo.Group == 1 && lSMessageTFEX.Sec == this.intzaOption.Records(num).Fields("sSeriesOC").Text.ToString()) { this.UpdateLastPriceBBOOption(num, "CALL", lSMessageTFEX.Price, lSMessageTFEX.Price - realtimeSeriesInfo.PrevFixPrice, realtimeSeriesInfo); if (base.IsAllowRender) { this.intzaOption.EndUpdate(num); } } else if (realtimeSeriesInfo.Group == 2 && lSMessageTFEX.Sec == this.intzaOption.Records(num).Fields("sSeriesOP").Text.ToString()) { this.UpdateLastPriceBBOOption(num, "PUT", lSMessageTFEX.Price, lSMessageTFEX.Price - realtimeSeriesInfo.PrevFixPrice, realtimeSeriesInfo); if (base.IsAllowRender) { this.intzaOption.EndUpdate(num); } } } } } } else if (realtimeSeriesInfo != null) { string keyValue = Utilities.PriceFormat(realtimeSeriesInfo.StrikPrice); int num = this.intzaOption.FindIndex("strike", keyValue); if (num > -1) { TPMessageTFEX tPMessageTFEX = (TPMessageTFEX)message; if (realtimeSeriesInfo.Group == 1 && tPMessageTFEX.OrderBookId.ToString() == this.intzaOption.Records(num).Fields("sSeriesOC").Text.ToString()) { this.UpdateBBOTopPrice_Options(num, "CALL", tPMessageTFEX.Side, tPMessageTFEX.Vol1.ToString(), tPMessageTFEX.Price1.ToString(), realtimeSeriesInfo); if (base.IsAllowRender) { this.intzaOption.EndUpdate(num); } } else if (realtimeSeriesInfo.Group == 2 && tPMessageTFEX.OrderBookId.ToString() == this.intzaOption.Records(num).Fields("sSeriesOP").Text.ToString()) { this.UpdateBBOTopPrice_Options(num, "PUT", tPMessageTFEX.Side, tPMessageTFEX.Vol1.ToString(), tPMessageTFEX.Price1.ToString(), realtimeSeriesInfo); if (base.IsAllowRender) { this.intzaOption.EndUpdate(num); } } } } } } catch (Exception ex) { this.ShowError("SecurityInfo::RecvMessage", ex); } }
public void ReceiveTfexMessage(IBroadcastMessage message, SeriesList.SeriesInformation realtimeSeriesInfo) { if (this.FormState != ClientBaseForm.ClientBaseFormState.Closing) { try { if (!this.IsInfoLoading && !this._currentIsSET) { if (this._seriesInfoTFEX != null && realtimeSeriesInfo != null) { string text = message.MessageType; switch (text) { case "TP": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { TPMessageTFEX tPMessageTFEX = (TPMessageTFEX)message; this.UpdateTopPriceInfo_TFEX(tPMessageTFEX.OrderBookId, tPMessageTFEX.Side, tPMessageTFEX.Price1, tPMessageTFEX.Price2, tPMessageTFEX.Price3, tPMessageTFEX.Price4, tPMessageTFEX.Price5, (long)tPMessageTFEX.Vol1, (long)tPMessageTFEX.Vol2, (long)tPMessageTFEX.Vol3, (long)tPMessageTFEX.Vol4, (long)tPMessageTFEX.Vol5); if (base.IsAllowRender) { this.intzaTP.EndUpdate(); } } break; case "LS": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { LSMessageTFEX lSMessageTFEX = (LSMessageTFEX)message; if (lSMessageTFEX.DealSource == 20) { if (ApplicationInfo.IndexInfoTfex.TXIState != "3C") { this.UpdateOpenOrProjectOpenPriceTFEX(ApplicationInfo.IndexInfoTfex.TXIState, lSMessageTFEX.Price, realtimeSeriesInfo); } else { this.UpdateOpenOrProjectOpenPriceTFEX(ApplicationInfo.IndexInfoTfex.TXMState, lSMessageTFEX.Price, realtimeSeriesInfo); } } this.UpdateLastPrice(lSMessageTFEX.Price, ""); this.UpdateHeaderPrice(lSMessageTFEX.High, lSMessageTFEX.Low); this.UpdateAllVolumeTFEX(lSMessageTFEX.Deals, (long)lSMessageTFEX.AccVolume, lSMessageTFEX.AccValue, (long)lSMessageTFEX.OpenQty, (long)lSMessageTFEX.LongQty, (long)lSMessageTFEX.ShortQty, lSMessageTFEX.OpenValue, lSMessageTFEX.LongValue, lSMessageTFEX.ShortValue, realtimeSeriesInfo.ContractSize, lSMessageTFEX.Basis); if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); this.intzaVolumeByBoard.EndUpdate(); } int num = lSMessageTFEX.Vol; int num2; int.TryParse(num.ToString(), out num2); this.UpdateTickerInfo_TFEX(lSMessageTFEX.Price, lSMessageTFEX.Side, (long)num2, lSMessageTFEX.LastTime, -1); if (base.IsAllowRender) { this.intzaLS.Redraw(); } } break; case "PO": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { POMessageTFEX pOMessageTFEX = (POMessageTFEX)message; if (ApplicationInfo.IndexInfoTfex.TXIState != "3C") { this.UpdateOpenOrProjectOpenPriceTFEX(ApplicationInfo.IndexInfoTfex.TXIState, pOMessageTFEX.Equilibrium_price_I, realtimeSeriesInfo); } else { this.UpdateOpenOrProjectOpenPriceTFEX(ApplicationInfo.IndexInfoTfex.TXMState, pOMessageTFEX.Equilibrium_price_I, realtimeSeriesInfo); } if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } break; case "SD": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { SDMessageTFEX sDMessageTFEX = (SDMessageTFEX)message; if (sDMessageTFEX.Lastdate.ToString().Length == 8) { this.intzaInfoTFEX.Item("last_date").Text = Utilities.GetDateFormat(sDMessageTFEX.Lastdate.ToString()); } IntzaBaseItem arg_487_0 = this.intzaInfoTFEX.Item("multiplier"); int num = sDMessageTFEX.Price_quot_factor; arg_487_0.Text = num.ToString(); if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } break; case "CA8": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { CA8MessageTFEX cA8MessageTFEX = (CA8MessageTFEX)message; if (ApplicationInfo.IndexInfoTfex.TXISession == 2) { this.intzaInfoTFEX.Item("settle").Text = Utilities.PriceFormat(cA8MessageTFEX.FixingPrice.ToString(), this._seriesInfoTFEX.NumOfDec); if (realtimeSeriesInfo.MarketCode == 4 || realtimeSeriesInfo.MarketCode == 5) { this.intzaInfoTFEX.Item("psettle").Text = Utilities.PriceFormat(cA8MessageTFEX.FixingPrice, this._seriesInfoTFEX.NumOfDec); } } else { this.intzaInfoTFEX.Item("psettle").Text = Utilities.PriceFormat(cA8MessageTFEX.FixingPrice, this._seriesInfoTFEX.NumOfDec); } if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } break; case "BU10": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { BU10MessageTFEX bU10MessageTFEX = (BU10MessageTFEX)message; this.intzaInfoTFEX.Item("tickSize").Text = Utilities.PriceFormat(bU10MessageTFEX.StepSize, this._seriesInfoTFEX.NumOfDec); if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } break; case "TCF": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { TCFMessageTFEX tCFMessageTFEX = (TCFMessageTFEX)message; this.intzaInfoTFEX.Item("ceiling").Text = FormatUtil.PriceFormat(realtimeSeriesInfo.Ceiling.ToString(), realtimeSeriesInfo.NumOfDec, ""); this.intzaInfoTFEX.Item("floor").Text = FormatUtil.PriceFormat(realtimeSeriesInfo.Floor.ToString(), realtimeSeriesInfo.NumOfDec, ""); this.intzaInfoTFEX.Item("psettle").Text = Utilities.PriceFormat(tCFMessageTFEX.PrevFixPrice, realtimeSeriesInfo.NumOfDec); if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } break; } } else if (message.MessageType == "IU") { IUMessageTFEX iUMessageTFEX = (IUMessageTFEX)message; if (this._seriesInfoTFEX != null && this._seriesInfoTFEX.UnderOrderBookId == iUMessageTFEX.OrderBookId) { if (this._seriesInfoTFEX.Group == 1 && this._seriesInfoTFEX.LastSalePrice != 0m) { this.intzaInfoTFEX.Item("basis").Text = (iUMessageTFEX.LastIndx - this._seriesInfoTFEX.StrikPrice).ToString(); this.intzaInfoTFEX.Item("basis").FontColor = Utilities.ComparePriceColor(iUMessageTFEX.LastIndx - this._seriesInfoTFEX.StrikPrice, 0m); } else if (this._seriesInfoTFEX.Group == 2 && this._seriesInfoTFEX.LastSalePrice != 0m) { this.intzaInfoTFEX.Item("basis").Text = (this._seriesInfoTFEX.StrikPrice - iUMessageTFEX.LastIndx).ToString(); this.intzaInfoTFEX.Item("basis").FontColor = Utilities.ComparePriceColor(this._seriesInfoTFEX.StrikPrice - iUMessageTFEX.LastIndx, 0m); } else if (this._seriesInfoTFEX.Group != 1 && this._seriesInfoTFEX.Group != 2 && this._seriesInfoTFEX.LastSalePrice != 0m && iUMessageTFEX.LastIndx != 0m) { this.intzaInfoTFEX.Item("basis").Text = (this._seriesInfoTFEX.LastSalePrice - iUMessageTFEX.LastIndx).ToString(); this.intzaInfoTFEX.Item("basis").FontColor = Utilities.ComparePriceColor(this._seriesInfoTFEX.LastSalePrice - iUMessageTFEX.LastIndx, 0m); } this.intzaInfoTFEX.Item("lastIndex").Text = iUMessageTFEX.LastIndx.ToString(); this.intzaInfoTFEX.Item("lastIndex").FontColor = MyColor.UnChgColor; } if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } } if (!this.IsBBOLoading) { string text = this._mainGroupType; if (text != null) { if (!(text == "Futures") && !(text == "Option")) { if (text == "Favorites") { this.ReceiveMessageBBO_TFEX(message, realtimeSeriesInfo); } } else if (this._subGroupType == "SET50Option") { this.ReceiveMessageBBO_Options(message, realtimeSeriesInfo); } else { this.ReceiveMessageBBO_TFEX(message, realtimeSeriesInfo); } } } } catch (Exception ex) { this.ShowError("ReceiveTfexMessage", ex); } } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { if (this.FormState != ClientBaseForm.ClientBaseFormState.Closing) { if (!this._isLoading) { try { if (this._canRecv && this._currPage == "CHART") { string messageType = message.MessageType; if (messageType != null) { if (messageType == "L+") { if (realtimeStockInfo != null && realtimeStockInfo.Symbol == this._currSymbol && !realtimeStockInfo.IsOddLot) { LSAccumulate lSAccumulate = (LSAccumulate)message; string text = string.Concat(new object[] { this._currSymbol, ";", lSAccumulate.Side, ";", lSAccumulate.LastPrice, ";", lSAccumulate.Volume, ";", lSAccumulate.LastTime.Replace(":", "") }); JSObject dOMWindow = this.webControl1.WebView.GetDOMWindow(); JSFunction jSFunction = (JSFunction)this.webControl1.WebView.EvalScript("dataInSTI"); object obj = jSFunction.Invoke(dOMWindow, new object[] { text }); } } } } } catch (Exception ex) { this.ShowError("ReceiveMessage", ex); } } } }
private void TopActiveUpdateRealTimes(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { if (base.InvokeRequired) { base.Invoke(new frmStockRanking.TopActiveUpdateRealTimesCallBack(this.TopActiveUpdateRealTimes), new object[] { message, realtimeStockInfo }); } else { try { if (this.activeGroupTypeTopActive == frmStockRanking.ActiveGroupTypes.MostActive_BigLot) { if (message.MessageType != "PD") { return; } } else if (!this.TopActiveVerifyBoard(realtimeStockInfo)) { return; } this.recDataRealTimeTopActive.Stock = ""; this.recDataRealTimeTopActive.StockNumber = 0; this.recDataRealTimeTopActive.AccVolume = 0L; this.recDataRealTimeTopActive.AccValue = 0m; this.recDataRealTimeTopActive.LastPrice = 0m; this.recDataRealTimeTopActive.HighPrice = 0m; this.recDataRealTimeTopActive.LowPrice = 0m; this.recDataRealTimeTopActive.Deals = 0; this.recDataRealTimeTopActive.ChangePrice = 0m; this.recDataRealTimeTopActive.ChangePricePct = 0m; this.recDataRealTimeTopActive.Swing = 0m; this.recDataRealTimeTopActive.SwingPct = 0m; this.recDataRealTimeTopActive.DisplayFlag = ""; this.recDataRealTimeTopActive.Prior = 0m; if (message.MessageType == "L+") { LSAccumulate lSAccumulate = (LSAccumulate)message; this.recDataRealTimeTopActive.StockNumber = lSAccumulate.SecurityNumber; this.recDataRealTimeTopActive.AccVolume = lSAccumulate.AccVolume * (long)realtimeStockInfo.BoardLot; this.recDataRealTimeTopActive.AccValue = lSAccumulate.AccValue; this.recDataRealTimeTopActive.LastPrice = lSAccumulate.LastPrice; this.recDataRealTimeTopActive.HighPrice = realtimeStockInfo.HighPrice; this.recDataRealTimeTopActive.LowPrice = realtimeStockInfo.LowPrice; this.recDataRealTimeTopActive.Deals = lSAccumulate.DealInMain; } else if (message.MessageType == "PD") { PDMessage pDMessage = (PDMessage)message; this.recDataRealTimeTopActive.StockNumber = pDMessage.SecurityNumber; this.recDataRealTimeTopActive.AccVolume = pDMessage.BiglotAccVolume; this.recDataRealTimeTopActive.AccValue = pDMessage.BiglotAccValue; this.recDataRealTimeTopActive.LastPrice = pDMessage.LastPrice; this.recDataRealTimeTopActive.HighPrice = pDMessage.HighPrice; this.recDataRealTimeTopActive.LowPrice = pDMessage.LowPrice; this.recDataRealTimeTopActive.Deals = pDMessage.BiglotDeals; } this.recDataRealTimeTopActive.DisplayFlag = realtimeStockInfo.DisplayFlag; this.recDataRealTimeTopActive.Stock = realtimeStockInfo.Symbol; this.recDataRealTimeTopActive.Prior = realtimeStockInfo.PriorPrice; if (realtimeStockInfo.PriorPrice > 0m && this.recDataRealTimeTopActive.LastPrice > 0m) { this.recDataRealTimeTopActive.ChangePrice = this.recDataRealTimeTopActive.LastPrice - realtimeStockInfo.PriorPrice; this.recDataRealTimeTopActive.ChangePricePct = this.recDataRealTimeTopActive.ChangePrice / realtimeStockInfo.PriorPrice * 100m; } if (realtimeStockInfo.PriorPrice > 0m && this.recDataRealTimeTopActive.LowPrice > 0m && this.recDataRealTimeTopActive.HighPrice > 0m) { this.recDataRealTimeTopActive.Swing = this.recDataRealTimeTopActive.HighPrice - this.recDataRealTimeTopActive.LowPrice; this.recDataRealTimeTopActive.SwingPct = this.recDataRealTimeTopActive.Swing / realtimeStockInfo.PriorPrice * 100m; } int num = -1; switch (this.activeGroupTypeTopActive) { case frmStockRanking.ActiveGroupTypes.MostActive_Main: case frmStockRanking.ActiveGroupTypes.MostActive_Foreign: { decimal d; if (decimal.TryParse(this.intzaTopActive.Records(this.maxTopTopActive).Fields("value").Text.ToString(), out d)) { if (this.recDataRealTimeTopActive.AccValue <= d) { return; } } break; } case frmStockRanking.ActiveGroupTypes.Gainer_Main: case frmStockRanking.ActiveGroupTypes.Gainer_Foreign: num = this.intzaTopActive.FindIndex("stock", realtimeStockInfo.Symbol); if (num == -1) { if (this.recDataRealTimeTopActive.ChangePrice <= 0m) { return; } decimal d2 = 0m; if (decimal.TryParse(this.intzaTopActive.Records(this.maxTopTopActive).Fields("pchg").Text.ToString(), out d2)) { if (this.recDataRealTimeTopActive.ChangePricePct <= d2) { return; } } } else if (this.recDataRealTimeTopActive.ChangePricePct <= 0m) { this.TopActive_ClearRecord(num); return; } break; case frmStockRanking.ActiveGroupTypes.Loser_Main: case frmStockRanking.ActiveGroupTypes.Loser_Foreign: num = this.intzaTopActive.FindIndex("stock", realtimeStockInfo.Symbol); if (num == -1) { if (this.recDataRealTimeTopActive.ChangePricePct >= 0m) { return; } decimal d2 = 0m; if (decimal.TryParse(this.intzaTopActive.Records(this.maxTopTopActive).Fields("pchg").Text.ToString(), out d2)) { if (this.recDataRealTimeTopActive.ChangePricePct >= d2) { return; } } } else if (this.recDataRealTimeTopActive.ChangePricePct >= 0m) { this.TopActive_ClearRecord(num); return; } break; case frmStockRanking.ActiveGroupTypes.MostSwing_Main: case frmStockRanking.ActiveGroupTypes.MostSwing_Foreign: num = this.intzaTopActive.FindIndex("stock", realtimeStockInfo.Symbol); if (num == -1) { if (this.recDataRealTimeTopActive.SwingPct <= 0m) { return; } decimal d3; if (decimal.TryParse(this.intzaTopActive.Records(this.maxTopTopActive).Fields("pswing").Text.ToString(), out d3)) { if (this.recDataRealTimeTopActive.SwingPct <= d3) { return; } } } else if (this.recDataRealTimeTopActive.SwingPct <= 0m) { this.TopActive_ClearRecord(num); return; } break; } this.TopActiveUpdateToGrid(num, this.recDataRealTimeTopActive, realtimeStockInfo); this.intzaTopActive.Sort(this.sortByNameTopActive, this.sortTypeTopActive); if (base.IsAllowRender) { this.intzaTopActive.Redraw(); } } catch (Exception ex) { this.ShowError("TopActiveUpdateRealTimes", ex); } } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { //if (ApplicationInfo.AutoTradeType > 0) //{ // return; //} try { string messageType = message.MessageType; if (messageType != null) { if (messageType == "L+") { this.Execute((LSAccumulate)message, realtimeStockInfo); } else if (messageType == "TP") { UpdateVolum((TPMessage)message, realtimeStockInfo); } } } catch (Exception ex) { throw ex; } }
public void ReceiveTfexMessage(IBroadcastMessage message, SeriesList.SeriesInformation realtimeSeriesInfo) { if (this.FormState != ClientBaseForm.ClientBaseFormState.Closing) { if (!base.IsLoadingData) { try { if (message.MessageType == "TP") { if (realtimeSeriesInfo.Symbol != "") { int num = ApplicationInfo.FavStockList[this._currFavPage].IndexOf(realtimeSeriesInfo.Symbol); if (num > -1 && num < 8) { this._bidControl[num].ReceiveTfexMessage(message, realtimeSeriesInfo); } } } else if (message.MessageType == "LS") { if (realtimeSeriesInfo.Symbol != "") { int num = ApplicationInfo.FavStockList[this._currFavPage].IndexOf(realtimeSeriesInfo.Symbol); if (num > -1 && num < 8) { this._bidControl[num].ReceiveTfexMessage(message, realtimeSeriesInfo); } } } } catch (Exception ex) { this.ShowError("SecurityInfo::RecvMessage", ex); } } } }
public void ReceiveTfexMessage(IBroadcastMessage message, SeriesList.SeriesInformation realtimeSeriesInfo) { try { string messageType = message.MessageType; if (messageType != null) { if (messageType == "#T9I") { OrderTFEXInfoClient orderTFEXInfoClient = (OrderTFEXInfoClient)message; if (orderTFEXInfoClient.Account == ApplicationInfo.AccInfo.CurrentAccount) { this.StartTimerLoadCredit(); ApplicationInfo.RemoveOrderNoFromAutoRefreshList_TFEX(orderTFEXInfoClient.OrderNumber.ToString()); } } } } catch (Exception ex) { this.ShowError("SendOrder:ReceiveTFEXMessage", ex); } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { if (!this.isLoadingData) { try { string messageType = message.MessageType; if (messageType != null) { if (!(messageType == "0I")) { if (messageType == "0B") { if (ApplicationInfo.SupportFreewill) { BroadCastOrderMessageClient broadCastOrderMessageClient = (BroadCastOrderMessageClient)message; if (ApplicationInfo.CanReceiveMessage(broadCastOrderMessageClient.EntryID)) { ApplicationInfo.RemoveOrderNoFromAutoRefreshList("", broadCastOrderMessageClient.Reserve2); } } } } else { this.ReceiveOrderInfo(message); } } } catch (Exception ex) { this.ShowError("ReceiveMessage", ex); } } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { try { string messageType = message.MessageType; if (messageType != null) { if (!(messageType == "0G")) { if (!(messageType == "0B")) { if (!(messageType == "0I")) { if (messageType == "SC") { if (ApplicationInfo.MarketState == "R") { if (this._frmConfirm != null) { this._frmConfirm.CloseMe(); } } } } else { OrderInfoClient orderInfoClient = (OrderInfoClient)message; if (orderInfoClient.Account == ApplicationInfo.AccInfo.CurrentAccount) { this.StartTimerLoadCredit(); ApplicationInfo.RemoveOrderNoFromAutoRefreshList(orderInfoClient.OrderNumber.ToString(), orderInfoClient.Reserve2); if (ApplicationInfo.SupportFreewill && (orderInfoClient.Reserve2 == "R" + this._returnOrderNumberFromServer.ToString() || orderInfoClient.Reserve2 == "OFFLINE")) { this._returnOrderNumberFromServer = -1L; if (ApplicationInfo.SupportOrderTimes) { if (this._currTimes + 1 <= this._OrdTimes) { this._currTimes++; Thread thread = new Thread(new ThreadStart(this.threadSendTimes)); thread.Start(); } else if (this._frmConfirm != null) { this._frmConfirm.CloseMe(); } } else if (this._frmConfirm != null) { this._frmConfirm.CloseMe(); } } } } } else if (ApplicationInfo.SupportFreewill) { BroadCastOrderMessageClient broadCastOrderMessageClient = (BroadCastOrderMessageClient)message; if (ApplicationInfo.CanReceiveMessage(broadCastOrderMessageClient.EntryID)) { ApplicationInfo.RemoveOrderNoFromAutoRefreshList("", broadCastOrderMessageClient.Reserve2); this.ShowMessageInFormConfirm(broadCastOrderMessageClient.Content, frmOrderFormConfirm.OpenStyle.Error); } } } else { this.ReceiveDGWReplyMessage(message); } } } catch (Exception ex) { this.ShowError("SendOrder:ReceiveMessage", ex); } }
private void ReceiveDGWReplyMessage(IBroadcastMessage message) { try { DGWOrderReplyMessage dGWOrderReplyMessage = (DGWOrderReplyMessage)message; if (dGWOrderReplyMessage.OrderNumber == this._returnOrderNumberFromServer) { this.ShowMessageInFormConfirm(string.Concat(new object[] { "Reject Order Number ", dGWOrderReplyMessage.OrderNumber, "\nReject Code : ", dGWOrderReplyMessage.ReplyCode, "\nReject Description : ", dGWOrderReplyMessage.ReplyMessage }), frmOrderFormConfirm.OpenStyle.ShowBox); } } catch (Exception ex) { this.ShowError("ReceiveDGWReplyMessage", ex); } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { if (!base.IsLoadingData) { try { if (ApplicationInfo.SupportFreewill) { string messageType = message.MessageType; if (messageType != null) { if (messageType == "0I") { OrderInfoClient orderInfoClient = (OrderInfoClient)message; if (this._isSending && (orderInfoClient.Reserve2 == "R" + this._currOrdNoPending || orderInfoClient.Reserve2 == "OFFLINE")) { if (this._lstOrder.Count > 0) { this._currSeqLineNo = this._lstOrder[0]; this._lstOrder.Remove(this._currSeqLineNo); Thread thread = new Thread(new ThreadStart(this.SendFreewillOrder)); thread.Start(); } else { this._isSending = false; } } } } } } catch (Exception ex) { this.ShowError("ReceiveMessage", ex); } } }
private void ReceiveMessageInfo(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { try { if (this._stockInfoSET != null) { if (realtimeStockInfo != null) { string messageType = message.MessageType; if (messageType != null) { if (!(messageType == "TP")) { if (!(messageType == "L+")) { if (!(messageType == "PO")) { if (!(messageType == "SS")) { if (messageType == "PD") { if (realtimeStockInfo.Number == this._stockInfoSET.Number) { PDMessage pDMessage = (PDMessage)message; this.UpdateBigLotValue(pDMessage.BiglotDeals, pDMessage.BiglotAccValue, pDMessage.BiglotAccVolume); if (base.IsAllowRender) { this.intzaVolumeByBoard.EndUpdate(); } } } } else if (realtimeStockInfo.Number == this._stockInfoSET.Number) { this.UpdateFromSS(realtimeStockInfo); if (base.IsAllowRender) { this.intzaInfo.EndUpdate(); } if (ApplicationInfo.MarketState == "S") { this.UpdateLastPrice(realtimeStockInfo.PriorPrice, ""); } } } else if (realtimeStockInfo.Number == this._stockInfoSET.Number) { POMessage pOMessage = (POMessage)message; if (ApplicationInfo.MarketState == "M") { this.UpdateProjectedClosePrice(pOMessage.ProjectedPrice); } else { this.UpdateOpenOrProjectOpenPrice(ApplicationInfo.MarketState, ApplicationInfo.MarketSession, pOMessage.ProjectedPrice); } this.UpdateProjectedVolume(pOMessage.ProjectedVolume); if (base.IsAllowRender) { this.intzaInfo.EndUpdate(); } } } else if (realtimeStockInfo.Number == this._stockInfoSET.Number) { LSAccumulate lSAccumulate = (LSAccumulate)message; this.UpdateLastPrice(lSAccumulate.LastPrice, lSAccumulate.ComparePrice); this.UpdatePriceInfo(lSAccumulate.LastPrice, realtimeStockInfo.HighPrice, realtimeStockInfo.LowPrice); this.UpdateAllVolume(lSAccumulate.DealInMain, lSAccumulate.AccVolume * (long)this._stockInfoSET.BoardLot, lSAccumulate.AccValue, lSAccumulate.OpenVolume * (long)this._stockInfoSET.BoardLot, lSAccumulate.BuyVolume * (long)this._stockInfoSET.BoardLot, lSAccumulate.SellVolume * (long)this._stockInfoSET.BoardLot); if (lSAccumulate.Side == string.Empty) { this.UpdateOpenOrProjectOpenPrice(ApplicationInfo.MarketState, ApplicationInfo.MarketSession, lSAccumulate.LastPrice); } this.UpdateMainBoardValue(lSAccumulate.DealInMain, lSAccumulate.AccVolume * (long)this._stockInfoSET.BoardLot, lSAccumulate.AccValue); if (base.IsAllowRender) { this.intzaInfo.EndUpdate(); this.intzaVolumeByBoard.EndUpdate(); } this.UpdateStockTicker(lSAccumulate.LastPrice, lSAccumulate.Side, Convert.ToInt64(lSAccumulate.Volume * (long)this._stockInfoSET.BoardLot), lSAccumulate.LastTime, -1); if (base.IsAllowRender) { this.intzaLS.Redraw(); } this.DrawTPBlinkColor(lSAccumulate); if (this._volAsVisible) { if (lSAccumulate.Side == "B") { this.wcGraphVolume.UpdateData((double)lSAccumulate.LastPrice, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, 0L); } else if (lSAccumulate.Side == "S") { this.wcGraphVolume.UpdateData((double)lSAccumulate.LastPrice, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, 0L, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot); } else { this.wcGraphVolume.UpdateData((double)lSAccumulate.LastPrice, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, 0L, 0L); } if (base.IsAllowRender) { this.wcGraphVolume.EndUpdate(); } } } } else if (realtimeStockInfo.Number == this._stockInfoSET.Number) { TPMessage tPMessage = (TPMessage)message; this.UpdateTopPriceInfo(tPMessage.Side, tPMessage.Price1, tPMessage.Price2, tPMessage.Price3, tPMessage.Price4, tPMessage.Price5, tPMessage.Volume1 * (long)this._stockInfoSET.BoardLot, tPMessage.Volume2 * (long)this._stockInfoSET.BoardLot, tPMessage.Volume3 * (long)this._stockInfoSET.BoardLot, tPMessage.Volume4 * (long)this._stockInfoSET.BoardLot, tPMessage.Volume5 * (long)this._stockInfoSET.BoardLot); if (base.IsAllowRender) { this.intzaTP.EndUpdate(); this.intzaBF.Redraw(); } } } } else if (message.MessageType == "IE") { IEMessage iEMessage = (IEMessage)message; if (iEMessage.Symbol == this._sectorSymbol && iEMessage.OriginalNumber == this._stockInfoSET.SectorNumber) { IndexStat.IndexItem sector = ApplicationInfo.IndexStatInfo.GetSector(this._stockInfoSET.SectorNumber); this.UpdateSector(iEMessage.IndexValue, sector.IndexChg, sector.IndexChgPct); } } else if (message.MessageType == "SC") { this.UpdateProjectedVolume(-1L); } } } catch (Exception ex) { this.ShowError("SecurityInfo::RecvMessage", ex); } }
private void ReceiveMessageBBO_TFEX(IBroadcastMessage message, SeriesList.SeriesInformation realtimeSeriesInfo) { try { if (realtimeSeriesInfo != null) { string messageType = message.MessageType; if (messageType != null) { if (!(messageType == "TP")) { if (!(messageType == "LS")) { if (!(messageType == "CA8")) { if (messageType == "TCF") { if (realtimeSeriesInfo.Symbol != "") { int num = this.intzaBBO.FindIndex("stock", realtimeSeriesInfo.Symbol); if (num > -1) { TCFMessageTFEX tCFMessageTFEX = (TCFMessageTFEX)message; STIControl.ExpandTableGrid.RecordItem recordItem = this.intzaBBO.Records(num); recordItem.Fields("prior").Text = Utilities.PriceFormat(tCFMessageTFEX.PrevFixPrice, realtimeSeriesInfo.NumOfDec); if (base.IsAllowRender) { this.intzaBBO.EndUpdate(num); } } } } } else if (realtimeSeriesInfo.Symbol != "") { int num = this.intzaBBO.FindIndex("stock", realtimeSeriesInfo.Symbol); if (num > -1) { CA8MessageTFEX cA8MessageTFEX = (CA8MessageTFEX)message; STIControl.ExpandTableGrid.RecordItem recordItem = this.intzaBBO.Records(num); recordItem.Fields("prior").Text = Utilities.PriceFormat(cA8MessageTFEX.FixingPrice, realtimeSeriesInfo.NumOfDec); if (base.IsAllowRender) { this.intzaBBO.EndUpdate(num); } } } } else if (realtimeSeriesInfo.Symbol != "") { int num = this.intzaBBO.FindIndex("stock", realtimeSeriesInfo.Symbol); if (num > -1) { LSMessageTFEX lSMessageTFEX = (LSMessageTFEX)message; this.UpdateLastPriceBBO_TFEX(num, lSMessageTFEX.Price, realtimeSeriesInfo.PrevFixPrice, (long)lSMessageTFEX.AccVolume, lSMessageTFEX.AccValue, (long)lSMessageTFEX.Deals, "", realtimeSeriesInfo, lSMessageTFEX.High, lSMessageTFEX.Low, (long)lSMessageTFEX.LongQty, (long)lSMessageTFEX.ShortQty); this.ShowUnderLineBBOTFEX(num, lSMessageTFEX.Price, realtimeSeriesInfo.BidPrice1.ToString(), realtimeSeriesInfo.OfferPrice1.ToString()); if (base.IsAllowRender) { this.intzaBBO.EndUpdate(num); } } } } else if (realtimeSeriesInfo.Symbol != string.Empty) { int num = this.intzaBBO.FindIndex("stock", realtimeSeriesInfo.Symbol); if (num > -1) { TPMessageTFEX tPMessageTFEX = (TPMessageTFEX)message; if (tPMessageTFEX.Side == "B") { realtimeSeriesInfo.BidVol1 = (long)tPMessageTFEX.Vol1; realtimeSeriesInfo.BidVol2 = (long)tPMessageTFEX.Vol2; realtimeSeriesInfo.BidVol3 = (long)tPMessageTFEX.Vol3; realtimeSeriesInfo.BidVol4 = (long)tPMessageTFEX.Vol4; realtimeSeriesInfo.BidVol5 = (long)tPMessageTFEX.Vol5; } else if (tPMessageTFEX.Side == "A") { realtimeSeriesInfo.OffVol1 = (long)tPMessageTFEX.Vol1; realtimeSeriesInfo.OffVol2 = (long)tPMessageTFEX.Vol2; realtimeSeriesInfo.OffVol3 = (long)tPMessageTFEX.Vol3; realtimeSeriesInfo.OffVol4 = (long)tPMessageTFEX.Vol4; realtimeSeriesInfo.OffVol5 = (long)tPMessageTFEX.Vol5; } this.UpdateBBOTopPrice_TFEX(num, tPMessageTFEX.Side, tPMessageTFEX.Price1.ToString(), (long)tPMessageTFEX.Vol1, realtimeSeriesInfo.PrevFixPrice, realtimeSeriesInfo.LastSalePrice, realtimeSeriesInfo); this.UpdateBidOfferVolPct(num, realtimeSeriesInfo.SumBidVol, realtimeSeriesInfo.SumOffVol); if (this.intzaBBO.Records(num).Rows > 1) { this.UpdateBBOBidsTFEX(this.intzaBBO.Records(num), realtimeSeriesInfo, tPMessageTFEX.Side, tPMessageTFEX.Price2.ToString(), (long)tPMessageTFEX.Vol2, tPMessageTFEX.Price3.ToString(), (long)tPMessageTFEX.Vol3, tPMessageTFEX.Price4.ToString(), (long)tPMessageTFEX.Vol4, tPMessageTFEX.Price5.ToString(), (long)tPMessageTFEX.Vol5); } if (base.IsAllowRender) { this.intzaBBO.EndUpdate(num); } } } } } } catch (Exception ex) { this.ShowError("SecurityInfo::RecvMessage", ex); } }
private void ReceiveOrderInfo(IBroadcastMessage message) { if (this.intzaOrderList.InvokeRequired) { this.intzaOrderList.Invoke(new ucViewOrder.ReceiveOrderInfoCallBack(this.ReceiveOrderInfo), new object[] { message }); } else { try { OrderInfoClient orderInfoClient = (OrderInfoClient)message; if (orderInfoClient.Account.Trim() == ApplicationInfo.AccInfo.CurrentAccount) { ucViewOrder.RecordData recordData = default(ucViewOrder.RecordData); recordData.OrderNumber = orderInfoClient.OrderNumber; recordData.Side = orderInfoClient.Side; recordData.Stock = orderInfoClient.Stock; recordData.Volume = orderInfoClient.Volume; recordData.Price = Utilities.PriceFormat(orderInfoClient.PriceToSET); if (!ApplicationInfo.SupportFreewill) { if (orderInfoClient.MatchedValue != orderInfoClient.PriceForCal * orderInfoClient.MatchedVolume) { recordData.Price = "*" + recordData.Price; } } recordData.Matched = orderInfoClient.MatchedVolume; recordData.PubVol = orderInfoClient.PublicVolume; recordData.OrderTimes = Utilities.GetTime(orderInfoClient.OrderTime.Trim()); int.TryParse(orderInfoClient.TrusteeID, out recordData.TrusteeID); recordData.Quote = orderInfoClient.Quote; recordData.OrderStatus = orderInfoClient.Status; recordData.ApprUserNo = orderInfoClient.ApproverId; recordData.OrderDate = orderInfoClient.OrderDate.Trim(); recordData.OrderTime = orderInfoClient.OrderTime.Trim(); recordData.IsAfterCloseOrder = (orderInfoClient.Reserve2 == "OFFLINE"); bool flag = false; int num; if (ApplicationInfo.SupportFreewill) { num = this.intzaOrderList.FindIndex("order_number", recordData.OrderNumber.ToString()); } else { num = this.intzaOrderList.FindIndex("key", recordData.OrderNumber + "_" + recordData.OrderDate.Trim()); } if (num > -1) { flag = true; } else if (orderInfoClient.OriginalMessageType == "1I") { flag = true; } if (flag) { this.intzaOrderList.BeginUpdate(); this.UpdateToGrid(num, recordData); if (num == -1) { if (this.intzaOrderList.Rows > 0) { this.intzaOrderList.SetFocusItem(0); } } this.intzaOrderList.Redraw(); } } } catch (Exception ex) { this.ShowError("ReceiveOrderInfo", ex); } } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { }
private void ReceiveOrderInfoTFEX(IBroadcastMessage message) { if (this.intzaOrderListTFEX.InvokeRequired) { this.intzaOrderListTFEX.Invoke(new ucViewOrder.ReceiveOrderInfoTFEXCallBack(this.ReceiveOrderInfoTFEX), new object[] { message }); } else { try { OrderTFEXInfoClient orderTFEXInfoClient = (OrderTFEXInfoClient)message; if (ApplicationInfo.CanReceiveMessage(orderTFEXInfoClient.Account)) { ucViewOrder.RecordData recordData = default(ucViewOrder.RecordData); recordData.OrderNumber = orderTFEXInfoClient.OrderNumber; recordData.Position = orderTFEXInfoClient.Position; recordData.Side = orderTFEXInfoClient.Side; recordData.Series = orderTFEXInfoClient.Series; recordData.Volume = orderTFEXInfoClient.Volume; recordData.Price = orderTFEXInfoClient.Price; recordData.Matched = orderTFEXInfoClient.MatchedVolume; recordData.PubVol = orderTFEXInfoClient.PublicVolume; recordData.OrderStatus = orderTFEXInfoClient.Status; recordData.Quote = orderTFEXInfoClient.Quote; recordData.OrderDate = orderTFEXInfoClient.SendDate; recordData.OrdType = orderTFEXInfoClient.OrderType; recordData.OrderTimes = orderTFEXInfoClient.OrderTime; bool flag = false; int num = this.intzaOrderListTFEX.FindIndex("key", recordData.OrderNumber + "_" + recordData.OrderDate); if (num > -1) { flag = true; } bool flag2 = false; if (flag) { flag2 = true; } else if (!flag && (orderTFEXInfoClient.OriginalMessageType == "1I" || orderTFEXInfoClient.OriginalMessageType == "2G")) { flag2 = true; } if (flag2) { this.UpdateToGrid_TFEX(num, recordData); this.intzaOrderListTFEX.EndUpdate(); } if (!this.Focused) { if (num == -1 && !ApplicationInfo.IsEquityAccount) { if (this.intzaOrderListTFEX.Rows > 0) { this.intzaOrderListTFEX.SetFocusItem(0); } } } } } catch (Exception ex) { this.ShowError("ReceiveOrderInfo_TFEX", ex); } } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { this.ViewOrderBox.ReceiveMessage(message, realtimeStockInfo); }
public void ReceiveTfexMessage(IBroadcastMessage message, SeriesList.SeriesInformation realtimeSeriesInfo) { if (!this.isLoadingData) { try { if (message.MessageType == "#T9I") { this.ReceiveOrderInfoTFEX(message); } } catch (Exception ex) { this.ShowError("ReceiveMessage", ex); } } }
public void ReceiveTfexMessage(IBroadcastMessage message, SeriesList.SeriesInformation realtimeSeriesInfo) { this.ViewOrderBox.ReceiveTfexMessage(message, realtimeSeriesInfo); }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { if (!base.IsLoadingData) { try { string messageType = message.MessageType; if (messageType != null) { if (!(messageType == "TP")) { if (!(messageType == "L+")) { if (messageType == "SS") { int num = ApplicationInfo.FavStockList[this._currFavPage].IndexOf(realtimeStockInfo.Symbol); if (num > -1 && num < 8) { this._bidControl[num].ReceiveMessage(message, realtimeStockInfo); } } } else { int num = ApplicationInfo.FavStockList[this._currFavPage].IndexOf(realtimeStockInfo.Symbol); if (num > -1 && num < 8) { this._bidControl[num].ReceiveMessage(message, realtimeStockInfo); } } } else { int num = ApplicationInfo.FavStockList[this._currFavPage].IndexOf(realtimeStockInfo.Symbol); if (num > -1 && num < 8) { this._bidControl[num].ReceiveMessage(message, realtimeStockInfo); } } } } catch (Exception ex) { this.ShowError("SecurityInfo::RecvMessage", ex); } } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { if (!this.isLoading) { if (message.MessageType == "IE") { IEMessage iEMessage = (IEMessage)message; IndexStat.IndexItem indexItem = ApplicationInfo.IndexStatInfo[iEMessage.Symbol]; if (indexItem != null) { int num = this.intzaSector.FindIndex("symbol", indexItem.Symbol); if (num > -1) { this._recvDataRealTime.Symbol = indexItem.Symbol; this._recvDataRealTime.Number = indexItem.Number; this._recvDataRealTime.AccVolume = iEMessage.AccVolume; this._recvDataRealTime.AccValue = iEMessage.AccValue; this._recvDataRealTime.Index = iEMessage.IndexValue; IndexStat.IndexItem indexItem2 = ApplicationInfo.IndexStatInfo[".SET"]; if (indexItem2 != null) { if (indexItem2.AccValue > 0m) { this._recvDataRealTime.Mkt = iEMessage.AccValue / indexItem2.AccValue * 100m; } } this._recvDataRealTime.IndexPrior = indexItem.Prior; this.UpdateToGrid(num + 1, this._recvDataRealTime); if (base.IsAllowRender) { this.intzaSector.EndUpdate(num); } } } } else if (message.MessageType.ToUpper() == "IS") { ISMessage iSMessage = (ISMessage)message; this.ShowSetIndex(iSMessage.Symbol); if (base.IsAllowRender) { this.intzaSET.EndUpdate(); } if (iSMessage.Symbol == ".SET") { this.MarketInfoUpdateByMT(iSMessage.MainAccVolume, iSMessage.MainAccValue, iSMessage.OddlotAccVolume, iSMessage.OddlotAccValue, iSMessage.BiglotAccVolume, iSMessage.BiglotAccValue, iSMessage.ForeignAccVolume, iSMessage.ForeignAccValue); this.MarketInfoUpdateByIS(iSMessage.Tick, iSMessage.Trin, iSMessage.SecurityUp, iSMessage.SecurityDown, iSMessage.SecurityNoChange, iSMessage.UpVolume * 1000L, iSMessage.DownVolume * 1000L, iSMessage.NoChangeVolume * 1000L); } if (base.IsAllowRender) { this.intzaMarketInfo.EndUpdate(); this.intzaBoard.Redraw(); } } } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { AutoTradeManager.Instance.ReceiveMessage(message, realtimeStockInfo); }
public void ReceiveTfexMessage(IBroadcastMessage message, SeriesList.SeriesInformation realtimeSeriesInfo) { if (message.MessageType == "LS") { if (this._filterType == frmTickerSetting.filterType.ALL_MARKET || this._filterType == frmTickerSetting.filterType.TFEX_ONLY) { this.UpdateTickerTFEX((LSMessageTFEX)message, realtimeSeriesInfo); } else if (this._filterType == frmTickerSetting.filterType.SYMBOL) { if (ApplicationInfo.TickerStockList.Contains(realtimeSeriesInfo.Symbol)) { this.UpdateTickerTFEX((LSMessageTFEX)message, realtimeSeriesInfo); } } else if (this._filterType == frmTickerSetting.filterType.FAV1 || this._filterType == frmTickerSetting.filterType.FAV2 || this._filterType == frmTickerSetting.filterType.FAV3 || this._filterType == frmTickerSetting.filterType.FAV4 || this._filterType == frmTickerSetting.filterType.FAV5) { if (ApplicationInfo.FavStockList[this._favListPage].Contains(realtimeSeriesInfo.Symbol)) { this.UpdateTickerTFEX((LSMessageTFEX)message, realtimeSeriesInfo); } } } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { try { if (!base.IsLoadingData) { if (this.currentPage == "Top Active") { if (realtimeStockInfo != null && (message.MessageType == "L+" || message.MessageType == "PD")) { this.TopActiveUpdateRealTimes(message, realtimeStockInfo); } } else if (this.currentPage == "Best Projected Open") { if (realtimeStockInfo != null) { if (!(realtimeStockInfo.MarketId != this.marketIdProjectedOpenPrice)) { if (this.boardTypeProjectedOpenPrice == frmStockRanking.BoardTypes.M) { if (realtimeStockInfo.StockBoard != "M") { return; } } else if (realtimeStockInfo.StockBoard != "F") { return; } if (message.MessageType == "L+") { LSAccumulate lSAccumulate = (LSAccumulate)message; int num = this.intzaProjectedOpen.FindIndex("stock", realtimeStockInfo.Symbol); if (num > -1) { decimal avg = 0m; if (lSAccumulate.AccVolume > 0L) { avg = lSAccumulate.AccValue / (lSAccumulate.AccVolume * (long)realtimeStockInfo.BoardLot); } decimal openPrice = -1m; long openVolume = 0L; if (lSAccumulate.Side == string.Empty) { openPrice = lSAccumulate.LastPrice; openVolume = lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot; } this.BestPOpen_UpdateByLS(this.intzaProjectedOpen.Records(num), avg, realtimeStockInfo.HighPrice, realtimeStockInfo.LowPrice, openPrice, openVolume, realtimeStockInfo); if (base.IsAllowRender) { this.intzaProjectedOpen.EndUpdate(num); } } } else if (message.MessageType == "PO") { if (!(ApplicationInfo.MarketState == "M")) { int num = this.intzaProjectedOpen.FindIndex("stock", realtimeStockInfo.Symbol); if (num > -1) { POMessage pOMessage = (POMessage)message; this.BestPOpen_UpdateByPO(num, pOMessage.ProjectedPrice, -1m, realtimeStockInfo); if (base.IsAllowRender) { this.intzaProjectedOpen.EndUpdate(num); } } } } } } } else if (this.currentPage == "Best Projected Close") { if (realtimeStockInfo == null) { if (message.MessageType == "SC") { this.intzaProjectedClose.Invalidate(); } } else if (!(ApplicationInfo.MarketState == "P") && !(ApplicationInfo.MarketState == "O")) { if (!(realtimeStockInfo.MarketId != this.marketIdProjectedClosePrice)) { if (this.boardTypeProjectedClosePrice == frmStockRanking.BoardTypes.M) { if (realtimeStockInfo.StockBoard != "M") { return; } } else if (realtimeStockInfo.StockBoard != "F") { return; } if (message.MessageType == "PO") { int num2 = this.intzaProjectedClose.FindIndex("stock", realtimeStockInfo.Symbol); if (num2 > -1) { POMessage pOMessage = (POMessage)message; this.BestPClose_UpdateByPO(num2, pOMessage.ProjectedPrice, realtimeStockInfo); if (base.IsAllowRender) { this.intzaProjectedClose.EndUpdate(num2); } } } } } } else if (this.currentPage == "Best Open Price") { if (message.MessageType == "L+") { } } } } catch (Exception ex) { this.ShowError("ReceiveMessage", ex); } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { if (!base.IsLoadingData) { try { if (message.MessageType == "IS") { if (this.currentPage == "View Oddlot") { if (this._stockInfoSET != null) { ISMessage iSMessage = (ISMessage)message; if (iSMessage.Symbol == ".SET") { this.ViewOddLotMktTotal(iSMessage.OddlotAccValue, iSMessage.OddlotAccVolume); if (base.IsAllowRender) { this.intzaViewOddLotInfo.EndUpdate(); } } } } } if (realtimeStockInfo != null) { if (this._stockInfoSET != null && realtimeStockInfo.Number == this._stockInfoSET.Number) { if (message.MessageType == "TP") { if (this.currentPage == "Stock in Play") { TPMessage tPMessage = (TPMessage)message; this.StockInPlayUpdateTopPrice(tPMessage.Side, tPMessage.Price1, tPMessage.Price2, tPMessage.Price3, tPMessage.Price4, tPMessage.Price5, tPMessage.Volume1 * (long)realtimeStockInfo.BoardLot, tPMessage.Volume2 * (long)realtimeStockInfo.BoardLot, tPMessage.Volume3 * (long)realtimeStockInfo.BoardLot, tPMessage.Volume4 * (long)realtimeStockInfo.BoardLot, tPMessage.Volume5 * (long)realtimeStockInfo.BoardLot); if (base.IsAllowRender) { this.intzaStockInPlay.EndUpdate(); } } else if (this.currentPage == "View Oddlot") { TPMessage tPMessage = (TPMessage)message; this.ViewOddLot_TopPrice(tPMessage.Side, tPMessage.Price1, tPMessage.Price2, tPMessage.Price3, tPMessage.Price4, tPMessage.Price5, tPMessage.Volume1, tPMessage.Volume2, tPMessage.Volume3, tPMessage.Volume4, tPMessage.Volume5); if (base.IsAllowRender) { this.intzaViewOddLot.Redraw(); } } } else if (message.MessageType == "L+") { LSAccumulate lSAccumulate = (LSAccumulate)message; if (this.currentPage == "Stock in Play") { this.StockInPlayUpdateBuySellVolume(lSAccumulate.Side, lSAccumulate.LastPrice, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, lSAccumulate.Deals); if (lSAccumulate.Side == "B") { this._buyDeals += lSAccumulate.Deals; } else if (lSAccumulate.Side == "S") { this._sellDeals += lSAccumulate.Deals; } this.StockInPlayUpdateTotalVolumeAndTotalDeals(lSAccumulate.BuyVolume, lSAccumulate.SellVolume, lSAccumulate.OpenVolume); if (base.IsAllowRender) { this.intzaStockInPlay.EndUpdate(); } } else if (this.currentPage == "Sale by Price") { if (this.SaleByPriceUpdateBuySell(lSAccumulate.LastPrice, lSAccumulate.Side, lSAccumulate.Deals, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, false)) { this.intzaSaleByPrice.Sort("price", SortType.Desc); } if (base.IsAllowRender) { this.intzaSaleByPrice.EndUpdate(); } if (lSAccumulate.Side == "B") { this.wcGraphVolume.UpdateData((double)lSAccumulate.LastPrice, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, 0L); } else if (lSAccumulate.Side == "S") { this.wcGraphVolume.UpdateData((double)lSAccumulate.LastPrice, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, 0L, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot); } else { this.wcGraphVolume.UpdateData((double)lSAccumulate.LastPrice, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, 0L, 0L); } if (base.IsAllowRender) { this.wcGraphVolume.EndUpdate(); } } else if (this.currentPage == "Sale by Time") { decimal avg = 0m; if (lSAccumulate.AccVolume > 0L) { avg = lSAccumulate.AccValue / (lSAccumulate.AccVolume * (long)realtimeStockInfo.BoardLot); } this.SaleByTimeUpdateGridData(lSAccumulate.Side, lSAccumulate.LastPrice, lSAccumulate.Volume * (long)realtimeStockInfo.BoardLot, realtimeStockInfo.ChangePrice, avg, lSAccumulate.LastTime, -1); if (base.IsAllowRender) { this.intzaSaleByTime.EndUpdate(); } } if (realtimeStockInfo.Number == this._stockInfoSET.Number) { this.UpdatePriceInfo(lSAccumulate.LastPrice, realtimeStockInfo.HighPrice, realtimeStockInfo.LowPrice); this.UpdateAllVolume(lSAccumulate.DealInMain, lSAccumulate.AccVolume * (long)this._stockInfoSET.BoardLot, lSAccumulate.AccValue, lSAccumulate.OpenVolume * (long)this._stockInfoSET.BoardLot, lSAccumulate.BuyVolume * (long)this._stockInfoSET.BoardLot, lSAccumulate.SellVolume * (long)this._stockInfoSET.BoardLot); if (lSAccumulate.Side == string.Empty) { this.UpdateOpenOrProjectOpenPrice(ApplicationInfo.MarketState, ApplicationInfo.MarketSession, lSAccumulate.LastPrice); } this.UpdateMainBoardValue(lSAccumulate.DealInMain, lSAccumulate.AccVolume * (long)this._stockInfoSET.BoardLot, lSAccumulate.AccValue); if (base.IsAllowRender) { this.intzaInfo.EndUpdate(); this.intzaVolumeByBoard.EndUpdate(); } this.UpdateStockTicker(lSAccumulate.LastPrice, lSAccumulate.Side, Convert.ToInt64(lSAccumulate.Volume * (long)this._stockInfoSET.BoardLot), lSAccumulate.LastTime, -1); if (base.IsAllowRender) { this.intzaLS.Redraw(); } } if (base.IsAllowRender) { this.intzaInfo.Redraw(); this.intzaLS.Redraw(); this.intzaVolumeByBoard.Redraw(); } } else if (message.MessageType == "PD") { if (realtimeStockInfo.Number == this._stockInfoSET.Number) { PDMessage pDMessage = (PDMessage)message; this.UpdateBigLotValue(pDMessage.BiglotDeals, pDMessage.BiglotAccValue, pDMessage.BiglotAccVolume); if (base.IsAllowRender) { this.intzaVolumeByBoard.EndUpdate(); } } } else if (message.MessageType == "LO") { LOMessage lOMessage = (LOMessage)message; if (this.currentPage == "View Oddlot") { this.ViewOddLotShowStockVolume(lOMessage.Price, lOMessage.OddlotDeals, lOMessage.OddlotAccVolume, lOMessage.OddlotAccValue); if (base.IsAllowRender) { this.intzaInfo.EndUpdate(); } this.UpdateStockTicker(lOMessage.Price, lOMessage.Side, lOMessage.Volume, lOMessage.LastTime, -1); if (base.IsAllowRender) { this.intzaLS.Redraw(); } } } else if (message.MessageType == "PO") { POMessage pOMessage = (POMessage)message; if (ApplicationInfo.MarketState == "M") { this.UpdateProjectedClosePrice(pOMessage.ProjectedPrice); } else { this.UpdateOpenOrProjectOpenPrice(ApplicationInfo.MarketState, ApplicationInfo.MarketSession, pOMessage.ProjectedPrice); } this.UpdateProjectedVolume(pOMessage.ProjectedVolume); if (base.IsAllowRender) { this.intzaInfo.EndUpdate(); } if (base.IsAllowRender) { this.intzaInfo.EndUpdate(); } } else if (message.MessageType == "SS") { if (realtimeStockInfo.Number == this._stockInfoSET.Number) { this.UpdateFromSS(realtimeStockInfo); if (base.IsAllowRender) { this.intzaInfo.EndUpdate(); } } } } } } catch (Exception ex) { this.ShowError("ReceiveMessage", ex); } } }
public void ReceiveTfexMessage(IBroadcastMessage message, SeriesList.SeriesInformation realtimeSeriesInfo) { }
private void ReceiveMessageBBO(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { try { string messageType = message.MessageType; if (messageType != null) { if (!(messageType == "TP")) { if (!(messageType == "L+")) { if (!(messageType == "SS")) { if (messageType == "PO") { int num; if (this._mainGroupType == "Favorites") { num = ApplicationInfo.FavStockList[this._bboPage].IndexOf(realtimeStockInfo.Symbol); } else { num = this.intzaBBO.FindIndex("stock", realtimeStockInfo.Symbol); } if (num > -1) { POMessage pOMessage = (POMessage)message; if (ApplicationInfo.MarketState == "M") { this.UpdateBBOPreClosePrice(num, pOMessage.ProjectedPrice, realtimeStockInfo); } else { this.UpdateBBOPreOpenPrice(num, pOMessage.ProjectedPrice, realtimeStockInfo); } if (base.IsAllowRender) { this.intzaBBO.EndUpdate(num); } } } } else if (realtimeStockInfo != null) { int num2; if (this._mainGroupType == "Favorites") { num2 = ApplicationInfo.FavStockList[this._bboPage].IndexOf(realtimeStockInfo.Symbol); } else { num2 = this.intzaBBO.FindIndex("stock", realtimeStockInfo.Symbol); } if (num2 > -1) { this.intzaBBO.Records(num2).Fields("prior").Text = realtimeStockInfo.PriorPrice; this.ShowDisplayFlagBBO(num2, realtimeStockInfo.DisplayFlag); if (base.IsAllowRender) { this.intzaBBO.EndUpdate(num2); } } } } else if (realtimeStockInfo != null) { int num3; if (this._mainGroupType == "Favorites") { num3 = ApplicationInfo.FavStockList[this._bboPage].IndexOf(realtimeStockInfo.Symbol); } else { num3 = this.intzaBBO.FindIndex("stock", realtimeStockInfo.Symbol); } if (num3 > -1) { LSAccumulate lSAccumulate = (LSAccumulate)message; this.ShowDisplayFlagBBO(num3, realtimeStockInfo.DisplayFlag); this.UpdateBBO_LS(num3, lSAccumulate.LastPrice, lSAccumulate.AccVolume * (long)realtimeStockInfo.BoardLot, lSAccumulate.AccValue, lSAccumulate.DealInMain, lSAccumulate.ComparePrice, realtimeStockInfo.HighPrice, realtimeStockInfo.LowPrice, lSAccumulate.BuyVolume * (long)realtimeStockInfo.BoardLot, lSAccumulate.SellVolume * (long)realtimeStockInfo.BoardLot, realtimeStockInfo); this.ShowUnderLineBBO(num3, lSAccumulate.LastPrice, realtimeStockInfo.BidPrice1, realtimeStockInfo.OfferPrice1); if (base.IsAllowRender) { this.intzaBBO.EndUpdate(num3); } this.DrawTPBBoBlink(num3, lSAccumulate); } } } else if (realtimeStockInfo != null) { int num4; if (this._mainGroupType == "Favorites") { num4 = ApplicationInfo.FavStockList[this._bboPage].IndexOf(realtimeStockInfo.Symbol); } else { num4 = this.intzaBBO.FindIndex("stock", realtimeStockInfo.Symbol); } if (num4 > -1) { TPMessage tPMessage = (TPMessage)message; if (tPMessage.Price1 > -1m) { this.UpdateBBOTopPrice(num4, tPMessage.Side, tPMessage.Price1, tPMessage.Volume1 * (long)realtimeStockInfo.BoardLot, realtimeStockInfo.PriorPrice, realtimeStockInfo.LastSalePrice, realtimeStockInfo); } if (tPMessage.Side == "B") { realtimeStockInfo.TotBidVol = (tPMessage.Volume1 + tPMessage.Volume2 + tPMessage.Volume3 + tPMessage.Volume4 + tPMessage.Volume5) * (long)realtimeStockInfo.BoardLot; } else { realtimeStockInfo.TotOfferVol = (tPMessage.Volume1 + tPMessage.Volume2 + tPMessage.Volume3 + tPMessage.Volume4 + tPMessage.Volume5) * (long)realtimeStockInfo.BoardLot; } this.UpdateBidOfferVolPct(num4, realtimeStockInfo.TotBidVol, realtimeStockInfo.TotOfferVol); if (this.intzaBBO.Records(num4).Rows > 1) { this.UpdateBBOBids(this.intzaBBO.Records(num4), realtimeStockInfo, tPMessage.Side, tPMessage.Price2, tPMessage.Volume2 * (long)realtimeStockInfo.BoardLot, tPMessage.Price3, tPMessage.Volume3 * (long)realtimeStockInfo.BoardLot, tPMessage.Price4, tPMessage.Volume4 * (long)realtimeStockInfo.BoardLot, tPMessage.Price5, tPMessage.Volume5 * (long)realtimeStockInfo.BoardLot); } if (base.IsAllowRender) { this.intzaBBO.EndUpdate(num4); } } } } } catch (Exception ex) { this.ShowError("SecurityInfo::RecvMessage", ex); } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { try { if (!this._isTickerLoading) { if (message.MessageType == "L+") { if (this._filterType == frmTickerSetting.filterType.ALL_MARKET || this._filterType == frmTickerSetting.filterType.SET_ONLY) { this.UpdateTicker((LSAccumulate)message, realtimeStockInfo); } else if (this._filterType == frmTickerSetting.filterType.SYMBOL) { if (ApplicationInfo.TickerStockList.Contains(realtimeStockInfo.Symbol)) { this.UpdateTicker((LSAccumulate)message, realtimeStockInfo); } } else if (this._filterType == frmTickerSetting.filterType.FAV1 || this._filterType == frmTickerSetting.filterType.FAV2 || this._filterType == frmTickerSetting.filterType.FAV3 || this._filterType == frmTickerSetting.filterType.FAV4 || this._filterType == frmTickerSetting.filterType.FAV5) { if (ApplicationInfo.FavStockList[this._favListPage].Contains(realtimeStockInfo.Symbol)) { this.UpdateTicker((LSAccumulate)message, realtimeStockInfo); } } } } } catch (Exception ex) { this.ShowError("SecurityInfo::RecvMessage", ex); } }
public SendMessageIntoChatRoom(Lazy <IQueue <Message> > queue, IBroadcastMessage broadcastMessage) : base(queue) { _broadcastMessage = broadcastMessage; }
public void ReceiveTfexMessage(IBroadcastMessage message, SeriesList.SeriesInformation realtimeSeriesInfo) { if (this.FormState != ClientBaseForm.ClientBaseFormState.Closing) { if (!base.IsLoadingData) { try { if (this._seriesInfoTFEX != null && realtimeSeriesInfo != null && realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { string messageType = message.MessageType; switch (messageType) { case "TP": if (this.currentPage == "Stock in Play") { TPMessageTFEX tPMessageTFEX = (TPMessageTFEX)message; this.StockInPlayUpdateTopPrice_TFEX(tPMessageTFEX.Side, tPMessageTFEX.Price1, tPMessageTFEX.Price2, tPMessageTFEX.Price3, tPMessageTFEX.Price4, tPMessageTFEX.Price5, (long)tPMessageTFEX.Vol1, (long)tPMessageTFEX.Vol2, (long)tPMessageTFEX.Vol3, (long)tPMessageTFEX.Vol4, (long)tPMessageTFEX.Vol5); if (base.IsAllowRender) { this.intzaStockInPlay.Redraw(); } } break; case "LS": { LSMessageTFEX lSMessageTFEX = (LSMessageTFEX)message; if (this.currentPage == "Sale by Time") { decimal avg = 0m; if (lSMessageTFEX.AccVolume > 0) { avg = lSMessageTFEX.AccValue / lSMessageTFEX.AccVolume; } this.SaleByTimeUpdateGridData_TFEX(lSMessageTFEX.Side, lSMessageTFEX.Price, (long)lSMessageTFEX.Vol, lSMessageTFEX.Price - realtimeSeriesInfo.PrevFixPrice, avg, lSMessageTFEX.LastTime, -1); if (base.IsAllowRender) { this.intzaSaleByTime.EndUpdate(); } } else if (this.currentPage == "Sale by Price") { if (this.SaleByPriceUpdateBuySell(lSMessageTFEX.Price, lSMessageTFEX.Side, 1, (long)lSMessageTFEX.Vol, false)) { this.intzaSaleByPrice.Sort("price", SortType.Desc); } if (base.IsAllowRender) { this.intzaSaleByPrice.EndUpdate(); } if (lSMessageTFEX.Side == "B" && lSMessageTFEX.DealSource != 20) { this.wcGraphVolume.UpdateData((double)lSMessageTFEX.Price, (long)lSMessageTFEX.Vol, (long)lSMessageTFEX.Vol, 0L); } else if (lSMessageTFEX.Side == "S" && lSMessageTFEX.DealSource != 20) { this.wcGraphVolume.UpdateData((double)lSMessageTFEX.Price, (long)lSMessageTFEX.Vol, 0L, (long)lSMessageTFEX.Vol); } else { this.wcGraphVolume.UpdateData((double)lSMessageTFEX.Price, (long)lSMessageTFEX.Vol, 0L, 0L); } if (base.IsAllowRender) { this.wcGraphVolume.EndUpdate(); } } else if (this.currentPage == "Stock in Play") { this.StockInPlayUpdateBuySellVolume_TFEX(lSMessageTFEX.Side, lSMessageTFEX.Price, (long)lSMessageTFEX.Vol, 1); if (lSMessageTFEX.Side == "B") { this._buyDeals++; } else if (lSMessageTFEX.Side == "S") { this._sellDeals++; } this.StockInPlayUpdateTotalVolumeAndTotalDeals((long)lSMessageTFEX.LongQty, (long)lSMessageTFEX.ShortQty, (long)lSMessageTFEX.OpenQty); if (base.IsAllowRender) { this.intzaStockInPlay.EndUpdate(); } } if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { LSMessageTFEX lSMessageTFEX2 = (LSMessageTFEX)message; if (lSMessageTFEX2.DealSource == 20) { if (ApplicationInfo.IndexInfoTfex.TXIState != "3C") { this.UpdateOpenOrProjectOpenPriceTFEX(ApplicationInfo.IndexInfoTfex.TXIState, lSMessageTFEX2.Price, realtimeSeriesInfo); } else { this.UpdateOpenOrProjectOpenPriceTFEX(ApplicationInfo.IndexInfoTfex.TXMState, lSMessageTFEX2.Price, realtimeSeriesInfo); } } this.UpdateAllVolumeTFEX(lSMessageTFEX2.Deals, (long)lSMessageTFEX2.AccVolume, lSMessageTFEX2.AccValue, (long)lSMessageTFEX2.OpenQty, (long)lSMessageTFEX2.LongQty, (long)lSMessageTFEX2.ShortQty, lSMessageTFEX2.OpenValue, lSMessageTFEX2.LongValue, lSMessageTFEX2.ShortValue, realtimeSeriesInfo.ContractSize, lSMessageTFEX2.Basis); if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); this.intzaVolumeByBoard.EndUpdate(); } int num = lSMessageTFEX2.Vol; int num2; int.TryParse(num.ToString(), out num2); this.UpdateTickerInfo_TFEX(lSMessageTFEX2.Price, lSMessageTFEX2.Side, (long)num2, lSMessageTFEX2.LastTime, -1); if (base.IsAllowRender) { this.intzaLS.Redraw(); } } break; } case "PO": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { POMessageTFEX pOMessageTFEX = (POMessageTFEX)message; if (ApplicationInfo.IndexInfoTfex.TXIState != "3C") { this.UpdateOpenOrProjectOpenPriceTFEX(ApplicationInfo.IndexInfoTfex.TXIState, pOMessageTFEX.Equilibrium_price_I, realtimeSeriesInfo); } else { this.UpdateOpenOrProjectOpenPriceTFEX(ApplicationInfo.IndexInfoTfex.TXMState, pOMessageTFEX.Equilibrium_price_I, realtimeSeriesInfo); } if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } break; case "SD": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { SDMessageTFEX sDMessageTFEX = (SDMessageTFEX)message; if (sDMessageTFEX.Lastdate.ToString().Length == 8) { this.intzaInfoTFEX.Item("last_date").Text = Utilities.GetDateFormat(sDMessageTFEX.Lastdate.ToString()); } IntzaBaseItem arg_756_0 = this.intzaInfoTFEX.Item("multiplier"); int num = sDMessageTFEX.Price_quot_factor; arg_756_0.Text = num.ToString(); if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } break; case "CA8": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { CA8MessageTFEX cA8MessageTFEX = (CA8MessageTFEX)message; if (ApplicationInfo.IndexInfoTfex.TXISession == 2) { this.intzaInfoTFEX.Item("settle").Text = Utilities.PriceFormat(cA8MessageTFEX.FixingPrice.ToString(), this._seriesInfoTFEX.NumOfDec); this.intzaInfoTFEX.Item("settle").FontColor = Utilities.ComparePriceColor(cA8MessageTFEX.FixingPrice, realtimeSeriesInfo.PrevFixPrice); if (realtimeSeriesInfo.MarketCode == 4 || realtimeSeriesInfo.MarketCode == 5) { this.intzaInfoTFEX.Item("psettle").Text = Utilities.PriceFormat(cA8MessageTFEX.FixingPrice, this._seriesInfoTFEX.NumOfDec); this.intzaInfoTFEX.Item("psettle").FontColor = MyColor.UnChgColor; } } else { this.intzaInfoTFEX.Item("psettle").Text = Utilities.PriceFormat(cA8MessageTFEX.FixingPrice, this._seriesInfoTFEX.NumOfDec); this.intzaInfoTFEX.Item("psettle").FontColor = MyColor.UnChgColor; } if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } break; case "BU10": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { BU10MessageTFEX bU10MessageTFEX = (BU10MessageTFEX)message; this.intzaInfoTFEX.Item("tickSize").Text = Utilities.PriceFormat(bU10MessageTFEX.StepSize, this._seriesInfoTFEX.NumOfDec); if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } break; case "TCF": if (realtimeSeriesInfo.Symbol == this._seriesInfoTFEX.Symbol) { TCFMessageTFEX tCFMessageTFEX = (TCFMessageTFEX)message; this.intzaInfoTFEX.Item("ceiling").Text = FormatUtil.PriceFormat(realtimeSeriesInfo.Ceiling.ToString(), realtimeSeriesInfo.NumOfDec, ""); this.intzaInfoTFEX.Item("floor").Text = FormatUtil.PriceFormat(realtimeSeriesInfo.Floor.ToString(), realtimeSeriesInfo.NumOfDec, ""); this.intzaInfoTFEX.Item("psettle").Text = Utilities.PriceFormat(tCFMessageTFEX.PrevFixPrice, realtimeSeriesInfo.NumOfDec); this.intzaInfoTFEX.Item("psettle").FontColor = MyColor.UnChgColor; if (base.IsAllowRender) { this.intzaInfoTFEX.EndUpdate(); } } break; } } } catch (Exception ex) { this.ShowError("ReceiveTfexMessage", ex); } } } }
public void ReceiveMessage(IBroadcastMessage message, StockList.StockInformation realtimeStockInfo) { try { if (!this.IsInfoLoading && this._currentIsSET) { this.ReceiveMessageInfo(message, realtimeStockInfo); } if (!this.IsBBOLoading) { this.ReceiveMessageBBO(message, realtimeStockInfo); } if (message.MessageType == "SC") { if (this._mainGroupType == "My Port" || this._mainGroupType == "Favorites" || this._mainGroupType == "SET" || this._mainGroupType == "MAI" || this._mainGroupType == "Derivative Warrant" || this._mainGroupType == "Warrant" || this._mainGroupType == "%CMPR") { if (ApplicationInfo.MarketState == "M" || ApplicationInfo.MarketState == "R") { this.SwitchColumns("pc"); } else if (ApplicationInfo.MarketState == "O" || ApplicationInfo.MarketState == "C") { this.SwitchColumns("avg"); } else if (ApplicationInfo.MarketState == "P") { this.SwitchColumns("po"); } } } } catch (Exception ex) { this.ShowError("ReceiveMessage", ex); } }