Пример #1
0
        public void IsolatedTriggerOrderTest(string contractCode)
        {
            bool   has_data = false;
            string tp       = null;

            if (contractCode != "*")
            {
                tp = contractCode.Split("-")[1].ToUpper();
            }
            client.IsolatedSubTriggerOrder(contractCode, delegate(SubTriggerOrderResponse data)
            {
                Console.WriteLine(JsonConvert.SerializeObject(data));
                if (tp != null)
                {
                    foreach (var item in data.data)
                    {
                        Assert.Equal(tp, item.tradePartition);
                    }
                }
                has_data = true;
            });
            System.Threading.Thread.Sleep(1000 * 15);
            Assert.Equal(true, has_data);
            client.IsolatedUnsubTriggerOrder(contractCode);
            System.Threading.Thread.Sleep(1000 * 5);
        }
Пример #2
0
        public void TriggerOrderTest(string contractCode)
        {
            WSNotifyClient client = new WSNotifyClient(config["AccessKey"], config["SecretKey"]);

            client.IsolatedSubTriggerOrder(contractCode, delegate(SubTriggerOrderResponse data)
            {
                Console.WriteLine(JsonConvert.SerializeObject(data));
            });
            System.Threading.Thread.Sleep(1000 * 30);
            client.IsolatedUnsubTriggerOrder(contractCode);
            System.Threading.Thread.Sleep(1000 * 15);

            client.CrossSubTriggerOrder(contractCode, delegate(SubTriggerOrderResponse data)
            {
                Console.WriteLine(JsonConvert.SerializeObject(data));
            });
            System.Threading.Thread.Sleep(1000 * 30);
            client.CrossUnsubTriggerOrder(contractCode);
            System.Threading.Thread.Sleep(1000 * 15);
        }