Esempio n. 1
0
        protected override TraderResult internalGetTradingAccountInfo()
        {
            TraderResult result = new TraderResult();
            result.Code = TraderResultEnum.SUCCESS;

            return result;
        }
Esempio n. 2
0
        protected override TraderResult internalGetTradingAccountInfo()
        {
            TraderResult result = new TraderResult();

            result.Code = TraderResultEnum.SUCCESS;

            return(result);
        }
Esempio n. 3
0
        protected override TraderResult internalSellStock(string code, float price, int num)
        {
            Console.WriteLine(String.Format("卖出股票:{0}, 卖出价格:{1}: 卖出数量: {2}, 时间: {3}", code, price, num, DateTime.Now));
            TraderResult result = new TraderResult();
            result.Code = TraderResultEnum.SUCCESS;

            result.EntrustNo = new Random().Next();
            return result;
        }
Esempio n. 4
0
        protected override TraderResult internalSellStock(string code, float price, int num)
        {
            Console.WriteLine(String.Format("卖出股票:{0}, 卖出价格:{1}: 卖出数量: {2}, 时间: {3}", code, price, num, DateTime.Now));
            TraderResult result = new TraderResult();

            result.Code = TraderResultEnum.SUCCESS;

            result.EntrustNo = new Random().Next();
            return(result);
        }
Esempio n. 5
0
        public TraderResult CancelStock(int entrustNo)
        {
            TraderResult ret = internalCancelStock(entrustNo);

            switch (ret.Code)
            {
            case TraderResultEnum.TIMEOUT:
                return(CancelStock(entrustNo));

            case TraderResultEnum.UNLOGIN:
                Login();
                return(CancelStock(entrustNo));

            case TraderResultEnum.ERROR:
            case TraderResultEnum.SUCCESS:
                return(ret);

            default:
                return(null);
            }
        }
Esempio n. 6
0
        public TraderResult BuyStock(string code, float price, int num)
        {
            TraderResult ret = internalBuyStock(code, price, num);

            switch (ret.Code)
            {
            case TraderResultEnum.TIMEOUT:
                return(BuyStock(code, price, num));

            case TraderResultEnum.UNLOGIN:
                Login();
                return(BuyStock(code, price, num));

            case TraderResultEnum.ERROR:
            case TraderResultEnum.SUCCESS:
                return(ret);

            default:
                return(null);
            }
        }
Esempio n. 7
0
        public TraderResult GetTradingAccountInfo()
        {
            TraderResult ret = internalGetTradingAccountInfo();

            switch (ret.Code)
            {
            case TraderResultEnum.TIMEOUT:
                return(GetTradingAccountInfo());

            case TraderResultEnum.UNLOGIN:
                Login();
                return(GetTradingAccountInfo());

            case TraderResultEnum.ERROR:
            case TraderResultEnum.SUCCESS:
                return(ret);

            default:
                return(null);
            }
        }