Beispiel #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);
                    }
                }));
            }
        }
Beispiel #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);
                    }
                }
            }
        }
Beispiel #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));
         }));
     }
 }
Beispiel #4
0
 void trader_QueryMoneyResponse(object sender, EsunnyEventArgs <TEsMoneyRspField> e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(queryMoneyResponse, sender, e);
     }
     else
     {
         this.idOrderBindingSource.DataSource = e.Value;
     }
 }
Beispiel #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));
         }
     }
 }
Beispiel #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);
                }
            }
        }
Beispiel #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());
            }
        }
Beispiel #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));
         }
     }
 }
Beispiel #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);
              }
            }));
              }
        }
Beispiel #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);
              }
            }

              }
        }
Beispiel #11
0
 void trader_QueryMoneyResponse(object sender, EsunnyEventArgs<TEsMoneyRspField> e)
 {
     if (this.InvokeRequired)
       {
     this.Invoke(queryMoneyResponse, sender, e);
       }
       else
       {
     this.idOrderBindingSource.DataSource = e.Value;
       }
 }
Beispiel #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());
              }
        }
Beispiel #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);
            }

              }
        }
Beispiel #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));
            }
              }
        }
Beispiel #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));
            }
              }
        }
Beispiel #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));
     }));
       }
 }