Esempio n. 1
0
 private void UpdateTradedData(ContractLastPrice lastPrice)
 {
     if (lastPrice == null)
     {
         return;
     }
     foreach (Transaction ts in m_tradedBrandInfoList)
     {
         if (ts.contract != lastPrice.contractMonth)
         {
             continue;
         }
         int premium;
         int.TryParse(ts.premium, out premium);
         if (premium != 0)
         {
             if (ts.transType == "0")
             {
                 ts.fixedPrice = (lastPrice.bidPrice + premium).ToString();
             }
             else
             {
                 ts.fixedPrice = (lastPrice.askPrice + premium).ToString();
             }
         }
     }
 }
Esempio n. 2
0
        private void UpdateDelistData(ContractLastPrice lastPrice)
        {
            if (lastPrice == null)
            {
                return;
            }

            foreach (Transaction dalist in m_delistBrandInfoList)
            {
                if (dalist.contract != lastPrice.contractMonth)
                {
                    continue;
                }
                int premium;
                int.TryParse(dalist.premium, out premium);
                if (premium != 0)
                {
                    if (dalist.transType == "0")
                    {
                        dalist.fixedPrice = (lastPrice.bidPrice + premium).ToString();
                    }
                    else
                    {
                        dalist.fixedPrice = (lastPrice.askPrice + premium).ToString();
                    }
                }
            }
        }
Esempio n. 3
0
 public void UpdateMarketData(ContractLastPrice obj)
 {
     if (DataManager.Instance.CurrentCode != null && obj != null)
     {
         if (DataManager.Instance.CurrentCode == obj.category && DataManager.Instance.CurrentContractCode == obj.contractMonth)
         {
             if (obj != null)
             {
                 if (lbs1 != null && lbs1.lbs.Count >= 4)
                 {
                     lbs1.lbs[1].Text = obj.bidPrice.ToString();
                     lbs1.lbs[3].Text = obj.askPrice.ToString();
                 }
             }
             else
             {
                 lbs1.lbs[1].Text = "0";
                 lbs1.lbs[3].Text = "0";
                 table.Updata("", 0, 0);
             }
         }
         //if (this.PublishControl1 != null)
         //{
         //    this.PublishControl1.TradingInfoCtrol.UpdateData(obj);
         //}
         table.Updata(obj.category, obj.bidPrice, obj.askPrice);
     }
 }
Esempio n. 4
0
        /// <summary>
        /// MQTT更新行情数据
        /// </summary>
        /// <param name="obj"></param>
        private void MQTTService_UpdataMarketDataEvent(ContractLastPrice obj)
        {
            if (table != null)
            {
                table.UpdateMarketData(obj);
            }

            if (this.m_publishForm != null)
            {
                this.m_publishForm.TradingInfoCtrol.UpdateData(obj);
            }
        }
Esempio n. 5
0
 public void UpdateMarketData(ContractLastPrice obj)
 {
     if (DataManager.Instance.CurrentCode != null && obj != null)
     {
         if (DataManager.Instance.CurrentCode == obj.category && DataManager.Instance.CurrentContractCode == obj.contractMonth)
         {
             if (obj != null)
             {
                 if (radLblRefreshCount != null && radLblAverage != null)
                 {
                     if (this.InvokeRequired)
                     {
                         this.BeginInvoke((MethodInvoker) delegate
                         {
                             radLblRefreshCount.Text = obj.bidPrice.ToString();
                             radLblAverage.Text      = obj.askPrice.ToString();
                         });
                     }
                     else
                     {
                         radLblRefreshCount.Text = obj.bidPrice.ToString();
                         radLblAverage.Text      = obj.askPrice.ToString();
                     }
                 }
             }
             else
             {
                 if (this.InvokeRequired)
                 {
                     this.BeginInvoke((MethodInvoker) delegate
                     {
                         radLblRefreshCount.Text = "0";
                         radLblAverage.Text      = "0";
                     });
                 }
                 else
                 {
                     radLblRefreshCount.Text = "0";
                     radLblAverage.Text      = "0";
                 }
                 Updata("", 0, 0);
             }
         }
         //if (this.PublishControl1 != null)
         //{
         //    this.PublishControl1.TradingInfoCtrol.UpdateData(obj);
         //}
         Updata(obj.category, obj.bidPrice, obj.askPrice);
     }
 }
Esempio n. 6
0
        /// <summary>
        /// 更新行情数据
        /// </summary>
        /// <param name="obj"></param>
        private void MQTTService_UpdataMarketDataEvent(ContractLastPrice obj)
        {
            if (DataManager.Instance.CurrentCode != null && obj != null)
            {
                if (DataManager.Instance.CurrentCode == obj.category && DataManager.Instance.CurrentContractCode == obj.contractMonth)
                {
                    UpdataMarketData(obj);
                }
                //if (this.PublishControl1 != null)
                //{
                //    this.PublishControl1.TradingInfoCtrol.UpdateData(obj);
                //}

                if (this.publishForm != null)
                {
                    this.publishForm.TradingInfoCtrol.UpdateData(obj);
                }

                table.Updata(obj.category, obj.bidPrice, obj.askPrice);
            }
        }
Esempio n. 7
0
 /// <summary>
 /// 更新条目绝对价格
 /// </summary>
 public void UpdateData(ContractLastPrice lastPrice)
 {
     UpdateDelistData(lastPrice);
     UpdateTradedData(lastPrice);
 }