示例#1
0
        void trader_ReturnOrderResponse(object sender, EsunnyEventArgs <TEsOrderInsertRspField> e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new Action(() =>
                {
                    EsunnyInputOrder order = EsunnyConvert.ConvertOrder(e.Value);

                    int i = orders.IndexOf(order);

                    if (i < 0)
                    {
                        orders.Add(order);
                    }
                    else
                    {
                        EsunnyInputOrder data = orders[i];

                        data.OrderTradeStatus = order.OrderTradeStatus;
                        data.TradeVolume      = order.TradeVolume;
                        data.Message          = order.Message;

                        orders.ResetItem(i);
                    }
                }));
            }
        }
示例#2
0
        void trader_QueryOrderResponse(object sender, EsunnyEventArgs <List <TEsOrderInsertRspField> > e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(queryOrderResponse, sender, e);
            }
            else
            {
                foreach (var item in e.Value)
                {
                    EsunnyInputOrder order = EsunnyConvert.ConvertOrder(item);

                    int i = orders.IndexOf(order);

                    if (i < 0)
                    {
                        orders.Add(order);
                    }
                    else
                    {
                        EsunnyInputOrder data = orders[i];

                        data.OrderTradeStatus = order.OrderTradeStatus;
                        data.TradeVolume      = order.TradeVolume;
                        data.Message          = order.Message;

                        orders.ResetItem(i);
                    }
                }
            }
        }
示例#3
0
 void quote_QuoteResponse(object sender, EsunnyEventArgs <TEsQuoteRspField> e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action(() =>
         {
             Log(string.Format("{0} : {1} {2} {3}", e.Value.Exchange, e.Value.Contract, e.Value.Buy, e.Value.Sell));
         }));
     }
 }
示例#4
0
 void trader_QueryMoneyResponse(object sender, EsunnyEventArgs <TEsMoneyRspField> e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(queryMoneyResponse, sender, e);
     }
     else
     {
         this.idOrderBindingSource.DataSource = e.Value;
     }
 }
示例#5
0
 void trader_QueryCommodityResponse(object sender, EsunnyEventArgs <List <TEsCommodityRspField> > e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(queryCommodityResponse, sender, e);
     }
     else
     {
         foreach (var item in e.Value)
         {
             Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.Name, item.Commodity, item.Dot));
         }
     }
 }
示例#6
0
        void trader_QueryContractResponse(object sender, EsunnyEventArgs <List <TEsContractRspField> > e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(queryContractResponse, sender, e);
            }
            else
            {
                foreach (var item in e.Value)
                {
                    Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.Name, item.Contract, item.EndTradeDay));

                    this.symbolCodeComboBox1.Properties.Items.Add(item);
                }
            }
        }
示例#7
0
        void trader_QueryExchangeStateResponse(object sender, EsunnyEventArgs <List <TEsExchangeStateRspField> > e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(queryExchangeStateResponse, sender, e);
            }
            else
            {
                StringBuilder buffer = new StringBuilder();

                foreach (var item in e.Value)
                {
                    buffer.AppendFormat("{0}:{1} ", item.Exchange, item.ExchangeState);
                }

                Log(buffer.ToString());
            }
        }
示例#8
0
 void trader_QueryCmbContractResponse(object sender, EsunnyEventArgs <List <TEsCmbContractRspField> > e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action(() =>
         {
             foreach (var item in e.Value)
             {
                 Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.CmbType, item.Contract1, item.Contract2));
             }
         }));
     }
     else
     {
         foreach (var item in e.Value)
         {
             Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.CmbType, item.Contract1, item.Contract2));
         }
     }
 }
示例#9
0
        void trader_ReturnOrderResponse(object sender, EsunnyEventArgs<TEsOrderInsertRspField> e)
        {
            if (this.InvokeRequired)
              {
            this.Invoke(new Action(() =>
            {
              EsunnyInputOrder order = EsunnyConvert.ConvertOrder(e.Value);

              int i = orders.IndexOf(order);

              if (i < 0)
              {
            orders.Add(order);
              }
              else
              {
            EsunnyInputOrder data = orders[i];

            data.OrderTradeStatus = order.OrderTradeStatus;
            data.TradeVolume = order.TradeVolume;
            data.Message = order.Message;

            orders.ResetItem(i);
              }
            }));
              }
        }
示例#10
0
        void trader_QueryOrderResponse(object sender, EsunnyEventArgs<List<TEsOrderInsertRspField>> e)
        {
            if (this.InvokeRequired)
              {
            this.Invoke(queryOrderResponse, sender, e);
              }
              else
              {

            foreach (var item in e.Value)
            {
              EsunnyInputOrder order = EsunnyConvert.ConvertOrder(item);

              int i =orders.IndexOf(order);

              if (i < 0)
              {
            orders.Add(order);
              }
              else
              {
            EsunnyInputOrder data = orders[i];

            data.OrderTradeStatus = order.OrderTradeStatus;
            data.TradeVolume = order.TradeVolume;
            data.Message = order.Message;

            orders.ResetItem(i);
              }
            }

              }
        }
示例#11
0
 void trader_QueryMoneyResponse(object sender, EsunnyEventArgs<TEsMoneyRspField> e)
 {
     if (this.InvokeRequired)
       {
     this.Invoke(queryMoneyResponse, sender, e);
       }
       else
       {
     this.idOrderBindingSource.DataSource = e.Value;
       }
 }
示例#12
0
        void trader_QueryExchangeStateResponse(object sender, EsunnyEventArgs<List<TEsExchangeStateRspField>> e)
        {
            if (this.InvokeRequired)
              {
            this.Invoke(queryExchangeStateResponse, sender, e);
              }
              else
              {
            StringBuilder buffer = new StringBuilder();

            foreach (var item in e.Value)
            {
              buffer.AppendFormat("{0}:{1} ",item.Exchange,item.ExchangeState);
            }

            Log(buffer.ToString());
              }
        }
示例#13
0
        void trader_QueryContractResponse(object sender, EsunnyEventArgs<List<TEsContractRspField>> e)
        {
            if (this.InvokeRequired)
              {
            this.Invoke(queryContractResponse, sender, e);
              }
              else
              {

            foreach (var item in e.Value)
            {
              Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.Name, item.Contract, item.EndTradeDay));

              this.symbolCodeComboBox1.Properties.Items.Add(item);
            }

              }
        }
示例#14
0
        void trader_QueryCommodityResponse(object sender, EsunnyEventArgs<List<TEsCommodityRspField>> e)
        {
            if (this.InvokeRequired)
              {
            this.Invoke(queryCommodityResponse, sender, e);
              }
              else
              {

            foreach (var item in e.Value)
            {
              Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.Name, item.Commodity, item.Dot));
            }
              }
        }
示例#15
0
        void trader_QueryCmbContractResponse(object sender, EsunnyEventArgs<List<TEsCmbContractRspField>> e)
        {
            if (this.InvokeRequired)
              {
            this.Invoke(new Action(() =>
            {
              foreach (var item in e.Value)
              {
            Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.CmbType, item.Contract1, item.Contract2));
              }
            }));
              }
              else
              {

            foreach (var item in e.Value)
            {
              Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.CmbType, item.Contract1, item.Contract2));
            }
              }
        }
示例#16
0
 void quote_QuoteResponse(object sender, EsunnyEventArgs<TEsQuoteRspField> e)
 {
     if (this.InvokeRequired)
       {
     this.Invoke(new Action(() =>
     {
       Log(string.Format("{0} : {1} {2} {3}", e.Value.Exchange, e.Value.Contract, e.Value.Buy, e.Value.Sell));
     }));
       }
 }