internal IBroadcastMessage CreateTfexMessage(string message)
 {
     IBroadcastMessage result;
     try
     {
         string text = message.Substring(0, 4).Trim();
         switch (text)
         {
         case "TP":
             result = new TPMessageTFEX(message);
             return result;
         case "LS":
             result = new LSMessageTFEX(message);
             return result;
         case "IUE":
             result = new IUEMessageTFEX(message);
             return result;
         case "MI":
             result = new MIMessageTFEX(message);
             return result;
         case "BC":
             result = new BCMessageTFEX(message);
             return result;
         case "CA8":
             result = new CA8MessageTFEX(message);
             return result;
         case "IU":
             result = new IUMessageTFEX(message);
             return result;
         case "PO":
             result = new POMessageTFEX(message);
             return result;
         case "SD":
             result = new SDMessageTFEX(message);
             return result;
         case "SS":
             result = new SSMessageTFEX(message);
             return result;
         case "ST":
             result = new STMessageTFEX(message);
             return result;
         case "SU":
             result = new SUMessageTFEX(message);
             return result;
         case "BU10":
             result = new BU10MessageTFEX(message);
             return result;
         case "#T9I":
             result = new OrderTFEXInfoClient(message);
             return result;
         case "TCF":
             result = new TCFMessageTFEX(message);
             return result;
         }
         result = null;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }
Exemplo n.º 2
0
 private void UpdateTickerTFEX(LSMessageTFEX msg, SeriesList.SeriesInformation realtimeSeriesInfo)
 {
     if (this.intzaTickerTFEX.InvokeRequired)
     {
         this.intzaTickerTFEX.Invoke(new ucTickerSlide.UpdateLastSaleTickerTFEXCallBack(this.UpdateTickerTFEX), new object[]
         {
             msg,
             realtimeSeriesInfo
         });
     }
     else
     {
         try
         {
             if (!string.IsNullOrEmpty(realtimeSeriesInfo.Symbol))
             {
                 int num = this.intzaTickerTFEX.FocusItemIndex + 1;
                 num++;
                 if (num > this.intzaTickerTFEX.Rows)
                 {
                     num = 1;
                 }
                 if (num + 1 <= this.intzaTickerTFEX.Rows)
                 {
                     this.intzaTickerTFEX.ClearAllTextByRow(num);
                     this.intzaTickerTFEX.EndUpdate(num);
                 }
                 STIControl.SortTableGrid.RecordItem recordItem = this.intzaTickerTFEX.Records(num - 1);
                 decimal num2 = 0m;
                 decimal num3 = 0m;
                 if (realtimeSeriesInfo.PrevFixPrice > 0m)
                 {
                     num2 = msg.Price - realtimeSeriesInfo.PrevFixPrice;
                     num3 = num2 / realtimeSeriesInfo.PrevFixPrice;
                 }
                 recordItem.Fields("stock").Text = realtimeSeriesInfo.Symbol;
                 recordItem.Fields("side").Text = msg.Side;
                 recordItem.Fields("volume").Text = msg.Vol;
                 recordItem.Fields("price").Text = Utilities.PriceFormat(msg.Price, realtimeSeriesInfo.NumOfDec);
                 recordItem.Fields("change").Text = num2;
                 recordItem.Fields("pchg").Text = num3;
                 Color fontColor = Utilities.ComparePriceCFColor(msg.Price, realtimeSeriesInfo);
                 Color fontColor2 = Color.Yellow;
                 if (msg.Side.ToString() == "B")
                 {
                     fontColor2 = MyColor.BuyColor;
                 }
                 else if (msg.Side.ToString() == "S")
                 {
                     fontColor2 = MyColor.SellColor;
                 }
                 recordItem.Fields("stock").FontColor = fontColor;
                 recordItem.Fields("side").FontColor = fontColor2;
                 recordItem.Fields("volume").FontColor = fontColor2;
                 recordItem.Fields("price").FontColor = fontColor;
                 recordItem.Fields("change").FontColor = fontColor;
                 recordItem.Fields("pchg").FontColor = fontColor;
                 this.intzaTickerTFEX.SetFocusItem(num - 1);
             }
         }
         catch (Exception ex)
         {
             this.ShowError("UpdateLastSaleTicker", ex);
         }
     }
 }
Exemplo n.º 3
0
 private void AddItem(LSMessageTFEX msgLS, string symbol, decimal changePrice, decimal changePricePct, long boardLot)
 {
     if (this.IsMonitoring)
     {
         lock (((ICollection)this._bcMessages).SyncRoot)
         {
             this._bcMessages.Enqueue(new AlertManager.AlertBcItem("L+", msgLS.Price, (long)msgLS.Vol, symbol, changePrice, changePricePct, boardLot));
         }
     }
 }