Ejemplo n.º 1
0
        //--------------------------------------------------------
        // 주식풀의 모든 주식의 재갱신을 요구한다
        public void loadStockHistory(PRICE_TYPE type = PRICE_TYPE.MIN)
        {
            lock (lockObject_) {
                foreach (KeyValuePair <int, StockData> keyValue in stockPool_)
                {
                    int       code      = keyValue.Key;
                    StockData stockData = keyValue.Value;
                    if (!stockData.checkUpdateTime())
                    {
                        continue;
                    }
                    stockData.setUpdateTime();

                    Logger.getInstance.consolePrint("* 데이터 요청 : {0:S15}:{1:D6} 주식 데이터", stockData.name_, stockData.code_);

                    switch (type)
                    {
                    case PRICE_TYPE.DAY:
                        List <PriceData> data = stockData.priceTable_[(int)PRICE_TYPE.DAY];
                        if (data.Count == 0)
                        {
                            StockEngine.getInstance.addOrder(new HistoryTheDaysStock(code));
                        }
                        break;

                    case PRICE_TYPE.MIN:
                        StockEngine.getInstance.addOrder(new HistoryTheMinsStock(code));
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void calculatePrice(PRICE_TYPE type)
        {
            List <PriceData> priceTable = this.priceTable(type);

            if (priceTable == null)
            {
                return;
            }
            Calculater calculater;

            calculater = new AvgCalculater();
            calculater.calculate(ref priceTable);

            calculater = new BollingerCalculater();
            calculater.calculate(ref priceTable);

            calculater = new MacdCalculater();
            calculater.calculate(ref priceTable);

            Evaluation stockAnalysis = new Evaluation();

            evalTotal_[(int)type] = stockAnalysis.analysis(priceTable);
            evalAvg_[(int)type]   = stockAnalysis.evalAvg();
            evalTech_[(int)type]  = stockAnalysis.evalTech();
        }
Ejemplo n.º 3
0
        public int nowPrice(PRICE_TYPE type)
        {
            List <PriceData> priceTable = this.priceTable(type);

            if (priceTable == null)
            {
                return(0);
            }
            return(priceTable[0].price_);
        }
Ejemplo n.º 4
0
 public List <PriceData> priceTable(PRICE_TYPE type)
 {
     lock (dataLock_) {
         List <PriceData> priceTable = priceTable_[(int)type];
         if (priceTable.Count == 0)
         {
             return(null);
         }
         return(priceTable);
     }
 }
Ejemplo n.º 5
0
 public void setUnit(PRICE_TYPE type)
 {
     priceType_ = type;
     if (priceType_ == PRICE_TYPE.DAY)
     {
         limitXCount_ = 50;
     }
     else
     {
         limitXCount_ = 150;
     }
     this.redrawStock();     //다시 그리기
 }
Ejemplo n.º 6
0
 public STOCK_EVALUATION evalTech(PRICE_TYPE type)
 {
     lock (dataLock_) {
         return(evalTech_[(int)type]);
     }
 }
Ejemplo n.º 7
0
 public void updatePrice(PRICE_TYPE type, int index, PriceData priceData)
 {
     priceTable_[(int)type].Insert(index, priceData);
 }
Ejemplo n.º 8
0
 //-------------------------------------------------------------
 //가격표관련 처리
 public void clearPrice(PRICE_TYPE type)
 {
     priceTable_[(int)type].Clear();
 }