Пример #1
0
        private void ChecknBuy(object aStockCode)
        {
            try
            {
                SqlDal sd = new SqlDal(cConnString);

                if (DateTime.Now <= sd.GetBuyLimitTime())
                {
                    string sCode = aStockCode.ToString();

                    DataSet dsCur   = sd.GetLatestStockJpBid(sCode);
                    DataSet dsBuy03 = sd.GetBUY03(sCode);

                    if (dsCur.Tables.Count > 0 && dsCur.Tables[0].Rows.Count > 0)
                    {
                        if (dsBuy03.Tables.Count > 0 && dsBuy03.Tables[0].Rows.Count > 0)
                        {
                            if (HasStock(sCode))
                            {
                                ChecknSell(sCode);
                            }
                            else
                            {
                                if (BuyCheck(dsCur, dsBuy03))
                                {
                                    Do_Buy(sCode);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                EventLog.WriteEntry("Simulator-gini_STOCKJPBID-ChecknBuy", e.ToString());
            }
        }
Пример #2
0
        public bool isGoodTiming(string aStockCode)
        {
            bool retbool = false;

            try
            {
                SqlDal  sd      = new SqlDal(cConnString);
                DataSet dsCur   = sd.GetLatestStockJpBid(aStockCode);
                DataSet dsBuy03 = sd.GetBUY03(aStockCode);

                if (dsCur.Tables.Count > 0 && dsCur.Tables[0].Rows.Count > 0)
                {
                    if (dsBuy03.Tables.Count > 0 && dsBuy03.Tables[0].Rows.Count > 0)
                    {
                        if (HasStock(aStockCode))
                        {
                            // 해당 종목 보유시에는 구매 Timing 이 아님
                            retbool = false;
                        }
                        else if (BuyCheck(dsCur, dsBuy03))
                        {
                            retbool = true;
                        }
                        else
                        {
                            retbool = false;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                EventLog.WriteEntry("Simulator-gini_STOCKJPBID-GoodTiming", e.ToString());
            }

            return(retbool);
        }