Beispiel #1
0
 public static baseDS.stockExchangeRow GetStockExchange(string stockCode)
 {
     baseDS.stockCodeRow stockRow = AppLibs.FindAndCache_StockCode(stockCode);
     if (stockRow == null)
     {
         return(null);
     }
     baseDS.stockExchangeRow stockExchangeRow = AppLibs.FindAndCache_StockExchange(stockRow.stockExchange);
     return(stockExchangeRow);
 }
Beispiel #2
0
        public static bool GetOwnStock(string stockCode, string portfolio, int buySellInterval, DateTime sellDate,
                                       out decimal qty, out decimal buyAmt)
        {
            baseDS.stockExchangeRow marketRow = GetStockExchange(stockCode);
            qty = 0; buyAmt = 0;
            baseDS.investorStockDataTable dataTbl = new baseDS.investorStockDataTable();
            LoadData(dataTbl, stockCode, portfolio);
            if (dataTbl.Count == 0)
            {
                return(false);
            }
            DateTime applicableDate = sellDate.AddDays(-marketRow.minBuySellDay);

            for (int idx = 0; idx < dataTbl.Count; idx++)
            {
                if (dataTbl[idx].buyDate > applicableDate)
                {
                    continue;
                }
                qty    += dataTbl[idx].qty;
                buyAmt += dataTbl[idx].buyAmt;
            }
            return(true);
        }
Beispiel #3
0
 public static void UpdateData(baseDS.stockExchangeRow data)
 {
     stockExchangeTA.Update(data);
     data.AcceptChanges();
 }