Пример #1
0
        protected override TraderResult internalGetTradingAccountInfo()
        {
            List <TradingAccount.StockHolderInfo> shis = GetStocks();
            TradingAccount account = new TradingAccount();

            account.AddStockHolder(shis);

            TraderResult result = new TraderResult();

            result.Code   = TraderResultEnum.SUCCESS;
            result.Result = account;

            return(result);
        }
Пример #2
0
 private void GetStocks(TradingAccount account, String[] ps)
 {
     for (int i = 1; i < ps.Length; i++)
     {
         String[]        stocks = ps[i].Split(new string[] { "\t" }, StringSplitOptions.None);
         StockHolderInfo shi    = new StockHolderInfo
         {
             StockCode     = stocks[0],
             StockName     = stocks[1],
             CurrentAmount = int.Parse(stocks[2]),
             EnableAmount  = int.Parse(stocks[3]),
             IncomeAmount  = int.Parse(stocks[4]),
             CostPrice     = float.Parse(stocks[5]),
             KeepCostPrice = float.Parse(stocks[6]),
             LastPrice     = float.Parse(stocks[7]),
             MarketValue   = float.Parse(stocks[10]),
             ExchangeName  = stocks[11],
             StockAccount  = stocks[12]
         };
         account.AddStockHolder(shi);
     }
 }
Пример #3
0
 private void GetStocks(TradingAccount account, String[] ps)
 {
     for (int i = 1; i < ps.Length; i++)
     {
         String[] stocks = ps[i].Split(new string[] { "\t" }, StringSplitOptions.None);
         StockHolderInfo shi = new StockHolderInfo
         {
            StockCode = stocks[0],
            StockName = stocks[1],
            CurrentAmount = int.Parse(stocks[2]),
            EnableAmount = int.Parse(stocks[3]),
            IncomeAmount = int.Parse(stocks[4]),
            CostPrice = float.Parse(stocks[5]),
            KeepCostPrice = float.Parse(stocks[6]),
            LastPrice = float.Parse(stocks[7]),
            MarketValue = float.Parse(stocks[10]),
            ExchangeName = stocks[11],
            StockAccount = stocks[12]
         };
         account.AddStockHolder(shi);
     }
 }