Beispiel #1
0
        static void Main(string[] args)
        {
            // investor, pwd, instrument, price for buy
            TestTrade tt = null;
            string    investor = "008107", pwd = "1", inst = "rb1905";
            double    price_for_buy = 3400;

            if (args.Length == 4)
            {
                investor      = args[0];
                pwd           = args[1];
                inst          = args[2];
                price_for_buy = double.Parse(args[3]);
            }

            tt = new TestTrade(investor, pwd, inst, price_for_buy);
            tt.Run();
            Console.WriteLine("Press any key to continue . . . ");
            Console.ReadKey(true);

            TestQuote tq = new TestQuote(investor, pwd, inst);

            tq.Run();
            Console.WriteLine("Press any key to continue . . . ");
            Console.ReadKey(true);

            tt.Release();
            tq.Release();
            Console.ReadKey(true);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            TestTrade tt = new TestTrade();

            tt.Run();
            Console.WriteLine("Press any key to continue . . . ");
            Console.ReadKey(true);

            TestQuote tq = new TestQuote();

            tq.Run();
            Console.WriteLine("Press any key to continue . . . ");
            Console.ReadKey(true);

            tt.Release();
            tq.Release();
            Console.ReadKey(true);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            // investor, pwd, instrument, price for buy
            TestTrade tt = null;
            string    addr = "tcp://180.168.146.187:10101", broker = "9999", investor = "008107", pwd = "1", inst = "rb2101", app = "simnow_client_test", code = "0000000000000000", proc = "";
            string    qaddr         = "tcp://180.168.146.187:10111";
            double    price_for_buy = 3900;

            tt = new TestTrade(inst, price_for_buy)
            {
                FrontAddr   = addr,
                Broker      = broker,
                Investor    = investor,
                Password    = pwd,
                AppID       = app,
                AuthCode    = code,
                ProductInfo = app,
            };

            tt.Run();
            Console.WriteLine("Press any key to continue . . . ");
            Console.ReadKey(true);
            //if(tt.IsLogin)
            //    tt.ReqOrderInsert("rb2101", DirectionType.Buy, OffsetType.Open, 4000, 2, 100000);
            //Console.WriteLine("Press any key to continue . . . ");
            //Console.ReadKey(true);

            TestQuote tq = new TestQuote(inst)
            {
                FrontAddr = qaddr,
                Broker    = broker,
            };

            tq.Run();
            Console.WriteLine("Press any key to continue . . . ");
            Console.ReadKey(true);

            tt.Release();
            tq.Release();
            Console.ReadKey(true);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            // investor, pwd, instrument, price for buy
            TestTrade tt = null;
            string    addr = "tcp://180.168.146.187:13030", broker = "9999", investor = "", pwd = "", inst = "rb1909", app = "", code = "", proc = "";
            string    qaddr         = "tcp://180.168.146.187:13040";
            double    price_for_buy = 3900;

            tt = new TestTrade(inst, price_for_buy)
            {
                FrontAddr   = addr,
                Broker      = broker,
                Investor    = investor,
                Password    = pwd,
                AppID       = app,
                AuthCode    = code,
                ProductInfo = proc,
            };

            tt.Run();
            Console.WriteLine("Press any key to continue . . . ");
            Console.ReadKey(true);

            TestQuote tq = new TestQuote(inst)
            {
                FrontAddr = qaddr,
                Broker    = broker,
            };

            tq.Run();
            Console.WriteLine("Press any key to continue . . . ");
            Console.ReadKey(true);

            tt.Release();
            tq.Release();
            Console.ReadKey(true);
        }