Example #1
0
        private void dbUpdate(TB_OPT10085 opt10085_data)
        {
            FileLog.PrintF("MyStock dbUpdate");
            using (MySqlConnection conn = new MySqlConnection(Config.GetDbConnStr()))
            {
                String dayTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                string sql     = @"UPDATE opt10085s SET
 current_price=@현재가
,evaluated_price=@평가금액
,selling_commission=@매도수수료
,commission=@수수료
,selling_tax=@매도세금
,will_profit_price=@손익분기매입가
,valuation_profit_and_loss=@평가손익
,earnings_rate=@수익률
,not_commission_profit_and_loss=@손익금액
,not_commission_profit_and_loss_rate=@손익율
,updated_at=@업데이트날짜
WHERE stock_code=@종목코드
;
";
                conn.Open();
                MySqlCommand cmd = new MySqlCommand(sql, conn);
                cmd.Parameters.AddWithValue("@현재가", opt10085_data.curr_amt);
                cmd.Parameters.AddWithValue("@평가금액", opt10085_data.evaluated_amt);
                cmd.Parameters.AddWithValue("@매도수수료", opt10085_data.buying_commission);
                cmd.Parameters.AddWithValue("@수수료", opt10085_data.commission);
                cmd.Parameters.AddWithValue("@매도세금", opt10085_data.selling_tax);
                cmd.Parameters.AddWithValue("@손익분기매입가", opt10085_data.will_profit_amt);
                cmd.Parameters.AddWithValue("@평가손익", opt10085_data.valuation_profit_loss);
                cmd.Parameters.AddWithValue("@수익률", opt10085_data.earnings_rt);
                cmd.Parameters.AddWithValue("@손익금액", opt10085_data.not_commission_profit_loss);
                cmd.Parameters.AddWithValue("@손익율", opt10085_data.profit_loss_rt);
                cmd.Parameters.AddWithValue("@업데이트날짜", dayTime);
                cmd.Parameters.AddWithValue("@종목코드", opt10085_data.stock_cd);
                cmd.ExecuteNonQuery();
            }
        }
Example #2
0
        private void orderReceivedMessage()
        {
            while (true)
            {
                OpenApi.Spell.SpellOpt tmp;
                while (orderQueue.TryDequeue(out tmp))
                {
                    FileLog.PrintF("orderReceivedMessage");

                    waitOneOpt10081(tmp.sTrCode);    // 멈추기..    //그런데 이거 없으면 에러남 0.2초 딜레이에서 유지해야할듯.
                    lock (jijs) {
                        ReceiveTrDataFactory        rtf = ReceiveTrDataFactory.getClass1Instance();
                        ReceiveTrData.ReceiveTrData rt  = rtf.getReceiveTrData(tmp.sTrCode);
                        int nRet = rt.Run(axKHOpenAPI, tmp);
                        tmp.startRunTime = DateTime.Now;
                        setCurrentRunSellOpt(tmp);
                        this.EnqueueByRunQueue(tmp);    //실행중인 데이터크기를 대충알기위해서
                        this.InRanUniqStockCount();
                    }
                }
                Thread.Sleep(200); //0.2초에 한번씩 확인
            }
        }
Example #3
0
 private void CheckTimeCurrentRunSellOpt()
 {
     while (true)
     {
         lock (lockerCurrentRunSpellOpt)
         {
             if (this.CurrentRunSpellOpt != null)
             {
                 DateTime startRunTime = this.CurrentRunSpellOpt.startRunTime;
                 DateTime checkRunTime = DateTime.Now;
                 TimeSpan gap          = checkRunTime - startRunTime;
                 int      iGap         = gap.Seconds;
                 String   key          = "[ALERT]" + this.CurrentRunSpellOpt.sTrCode + "::" + this.CurrentRunSpellOpt.stockCode + "::" + this.CurrentRunSpellOpt.endDate + "::iGap=> " + iGap;
                 if (iGap > 30)
                 {
                     FileLog.PrintF(key);
                     OpenApi.Spell.SpellOpt      tmp = this.CurrentRunSpellOpt.ShallowCopy();
                     ReceiveTrDataFactory        rtf = ReceiveTrDataFactory.getClass1Instance();
                     ReceiveTrData.ReceiveTrData rt  = rtf.getReceiveTrData(tmp.sTrCode);
                     int nRet = rt.Run(axKHOpenAPI, tmp);  //연속조회시
                     tmp.startRunTime = DateTime.Now;
                     setCurrentRunSellOpt(tmp);
                     this.DequeueByRunQueue();    //안에 들어있는 걸빼고
                     this.EnqueueByRunQueue(tmp); //지금 생성한것을 넣음
                     /*장애가 났다는것을 알릴수있는 어떤 함수가 필요하다고 생각함*/
                 }
             }
             else
             {
                 String key = "[ALERT2] 진행중인 데이터가 없다.";
                 FileLog.PrintF(key);
             }
         }
         Thread.Sleep(300000); //5분에 한번씩 돔
     }
 }
Example #4
0
 public void waitOneOpt10081(String sTrCode)
 {
     FileLog.PrintF("waitOneOpt10081 sTrCode=>" + sTrCode);
     _evtOpt10081.WaitOne();
 }
Example #5
0
 public void Start()
 {
     FileLog.PrintF("Start");
     stockCodeList = setStockCodeList();
     SetRegRealAll();
 }
Example #6
0
        private List <String> setStockCodeList()
        {
            //약간 문제가 있었다. elw가 가끔 키움에서 안가져오는것같다. 그래서 장내랑,코스피만 하는걸로..
            List <String> ttt = new List <String>();

            FileLog.PrintF("setStockCodeList START");
            List <String> arrTmp = new List <String>();
            String        tmp    = axKHOpenAPI.GetCodeListByMarket("0");

            //FileLog.PrintF("setStockCodeList tmp=>"+ tmp);
            String[] arrT = tmp.Split(';');

            String tmp1 = axKHOpenAPI.GetCodeListByMarket("10");

            //FileLog.PrintF("setStockCodeList tmp1=>" + tmp1);
            String[] arrT1 = tmp1.Split(';');
            var      tt1   = arrT1.Concat(arrT).ToArray();

            Array.Sort(tt1);
            foreach (String tt in tt1)
            {
                //FileLog.PrintF("tt1 =" + tt);
                if (!tt.Equals(""))
                {
                    if (!ttt.Contains(tt))
                    {
                        ttt.Add(tt);
                    }
                }
            }
            FileLog.PrintF("setStockCodeList END");
            FileLog.PrintF("setStockCodeList11 ttt.count=>" + ttt.Count());
            ttt.Remove("069500");   //KODEX200
            ttt.Remove("069660");   //KOSEF200
            ttt.Remove("091160");   //KODEX반도체
            ttt.Remove("091170");   //KODEX은행
            ttt.Remove("091180");   //KODEX자동차
            ttt.Remove("099140");   //KODEXChinaH
            ttt.Remove("100910");   //KOSEFKRX100
            ttt.Remove("101280");   //KODEXJapan
            ttt.Remove("102780");   //KODEX삼성그룹
            ttt.Remove("102960");   //KODEX조선
            ttt.Remove("102970");   //KODEX증권
            ttt.Remove("104520");   //KOSEF블루칩
            ttt.Remove("104530");   //KOSEF고배당
            ttt.Remove("114260");   //KODEX국고채
            ttt.Remove("114470");   //KOSEF국고채
            ttt.Remove("114800");   //KODEX인버스
            ttt.Remove("117460");   //KODEX에너지화학
            ttt.Remove("117680");   //KODEX철강
            ttt.Remove("117700");   //KODEX건설
            ttt.Remove("122260");   //KOSEF통안채
            ttt.Remove("122630");   //KODEX레버리지
            ttt.Remove("130730");   //KOSEF단기자금
            ttt.Remove("132030");   //KODEX골드선물(H)
            ttt.Remove("136280");   //KODEX소비재
            ttt.Remove("138230");   //KOSEF달러선물
            ttt.Remove("138910");   //KODEX구리선물(H)
            ttt.Remove("138920");   //KODEX콩선물(H)
            ttt.Remove("139660");   //KOSEF달러인버스선물
            ttt.Remove("140700");   //KODEX보험
            ttt.Remove("140710");   //KODEX운송
            ttt.Remove("144600");   //KODEX은선물(H)
            ttt.Remove("148070");   //KOSEF10년국고채
            ttt.Remove("152280");   //KOSEF200선물
            ttt.Remove("152380");   //KODEX10년국채선물
            ttt.Remove("153130");   //KODEX단기채권
            ttt.Remove("153270");   //KOSEF100
            ttt.Remove("156080");   //KODEXMSCIKOREA
            ttt.Remove("167860");   //KOSEF10년국고채레버리지
            ttt.Remove("169950");   //KODEX중국본토A50
            ttt.Remove("176950");   //KODEX인버스국채선물10년
            ttt.Remove("185680");   //KODEX미국바이오(합성)
            ttt.Remove("200020");   //KODEX미국IT(합성)
            ttt.Remove("200030");   //KODEX미국산업재(합성)
            ttt.Remove("200040");   //KODEX미국금융(합성)
            ttt.Remove("200050");   //KODEXMSCI독일(합성)
            ttt.Remove("200250");   //KOSEF인디아(합성)
            ttt.Remove("204450");   //KODEXChinaH레버리지(H)
            ttt.Remove("211900");   //KODEX배당성장
            ttt.Remove("213610");   //KODEX삼성그룹밸류
            ttt.Remove("214980");   //KODEX단기채권PLUS
            ttt.Remove("218420");   //KODEX미국에너지(합성)
            ttt.Remove("219480");   //KODEXS&P500선물(H)
            ttt.Remove("223190");   //KODEX200내재가치
            ttt.Remove("225800");   //KOSEF미국달러선물레버리지(합성)
            ttt.Remove("226490");   //KODEX코스피
            ttt.Remove("226980");   //KODEX200중소형
            ttt.Remove("229200");   //KODEX코스닥150
            ttt.Remove("229720");   //KODEXKTOP30
            ttt.Remove("230480");   //KOSEF미국달러선물인버스2X(합성)
            ttt.Remove("233740");   //KODEX코스닥150레버리지
            ttt.Remove("237350");   //KODEX200대형
            ttt.Remove("237370");   //KODEX배당성장채권혼합
            ttt.Remove("083350");   //동북아10호
            ttt.Remove("083360");   //동북아11호
            ttt.Remove("083370");   //동북아12호
            ttt.Remove("083380");   //동북아13호
            ttt.Remove("083390");   //동북아14호
            ttt.Remove("083570");   //아시아10호
            ttt.Remove("083580");   //아시아11호
            ttt.Remove("083590");   //아시아12호
            ttt.Remove("083600");   //아시아13호
            ttt.Remove("083610");   //아시아14호
            ttt.Remove("083620");   //아시아15호
            ttt.Remove("088980");   //맥쿼리인플라
            ttt.Remove("090970");   //코리아01호
            ttt.Remove("090980");   //코리아02호
            ttt.Remove("090990");   //코리아03호
            ttt.Remove("091000");   //코리아04호
            ttt.Remove("091210");   //TIGERKRX100
            ttt.Remove("091220");   //TIGER은행
            ttt.Remove("091230");   //TIGER반도체
            ttt.Remove("092630");   //바다로3호
            ttt.Remove("094800");   //맵스리얼티1
            ttt.Remove("096300");   //베트남개발1
            ttt.Remove("097750");   //TREX중소형가치
            ttt.Remove("098560");   //TIGER미디어통신
            ttt.Remove("099340");   //하나니켈1호
            ttt.Remove("099350");   //하나니켈2호
            ttt.Remove("102110");   //TIGER200
            ttt.Remove("105010");   //TIGER라틴
            ttt.Remove("105190");   //KINDEX200
            ttt.Remove("105270");   //KINDEX성장대형F15
            ttt.Remove("105780");   //KStar5대그룹주
            ttt.Remove("107560");   //GIANT현대차그룹
            ttt.Remove("108440");   //KINDEX코스닥스타
            ttt.Remove("108450");   //KINDEX삼성그룹SW
            ttt.Remove("108590");   //TREX200
            ttt.Remove("108630");   //FIRST스타우량
            ttt.Remove("114100");   //KStar국고채
            ttt.Remove("114460");   //KINDEX국고채
            ttt.Remove("114820");   //TIGER국채3
            ttt.Remove("117690");   //TIGER차이나
            ttt.Remove("122090");   //ARIRANGKOSPI50
            ttt.Remove("122390");   //TIGER코스닥프리미어
            ttt.Remove("123310");   //TIGER인버스
            ttt.Remove("123320");   //TIGER레버리지
            ttt.Remove("123760");   //KStar레버리지
            ttt.Remove("130680");   //TIGER원유선물(H)
            ttt.Remove("131890");   //KINDEX삼성그룹EW
            ttt.Remove("133690");   //TIGER나스닥100
            ttt.Remove("136340");   //KStar우량회사채
            ttt.Remove("137610");   //TIGER농산물선물(H)
            ttt.Remove("137930");   //마이다스커버드콜
            ttt.Remove("138520");   //TIGER삼성그룹
            ttt.Remove("138530");   //TIGERLG그룹+
            ttt.Remove("138540");   //TIGER현대차그룹+
            ttt.Remove("139200");   //하이골드2호
            ttt.Remove("139220");   //TIGER200건설
            ttt.Remove("139230");   //TIGER200중공업
            ttt.Remove("139240");   //TIGER200철강소재
            ttt.Remove("139250");   //TIGER200에너지화학
            ttt.Remove("139260");   //TIGER200IT
            ttt.Remove("139270");   //TIGER200금융
            ttt.Remove("139280");   //TIGER경기방어
            ttt.Remove("139290");   //TIGER200경기소비재
            ttt.Remove("139310");   //TIGER금속선물(H)
            ttt.Remove("139320");   //TIGER금은선물(H)
            ttt.Remove("140570");   //KStar수출주
            ttt.Remove("140580");   //KStar우량업종
            ttt.Remove("140890");   //트러스제7호
            ttt.Remove("140910");   //광희리츠
            ttt.Remove("140950");   //파워K100
            ttt.Remove("141240");   //ARIRANGK100EW
            ttt.Remove("143460");   //KINDEX밸류대형
            ttt.Remove("143850");   //TIGERS&P500선물(H)
            ttt.Remove("143860");   //TIGER헬스케어
            ttt.Remove("145270");   //케이탑리츠
            ttt.Remove("145670");   //KINDEX인버스
            ttt.Remove("145850");   //TREX펀더멘탈200
            ttt.Remove("147970");   //TIGER모멘텀
            ttt.Remove("148020");   //KStar200
            ttt.Remove("148040");   //PIONEERSRI
            ttt.Remove("150460");   //TIGER중국소비테마
            ttt.Remove("152100");   //ARIRANG200
            ttt.Remove("152180");   //TIGER생활필수품
            ttt.Remove("152500");   //KINDEX레버리지
            ttt.Remove("152550");   //한국ANKOR유전
            ttt.Remove("152870");   //파워K200
            ttt.Remove("153360");   //하이골드3호
            ttt.Remove("155900");   //바다로19호
            ttt.Remove("157450");   //TIGER유동자금
            ttt.Remove("157490");   //TIGER소프트웨어
            ttt.Remove("157500");   //TIGER증권
            ttt.Remove("157510");   //TIGER자동차
            ttt.Remove("157520");   //TIGER화학
            ttt.Remove("159650");   //하이골드8호
            ttt.Remove("159800");   //마이티K100
            ttt.Remove("160580");   //TIGER구리실물
            ttt.Remove("161490");   //ARIRANG방어주
            ttt.Remove("161500");   //ARIRANG주도주
            ttt.Remove("161510");   //ARIRANG고배당주
            ttt.Remove("166400");   //TIGER커버드C200
            ttt.Remove("168300");   //KTOP50
            ttt.Remove("168490");   //한국패러랠
            ttt.Remove("168580");   //KINDEX중국본토CSI300
            ttt.Remove("170350");   //TIGER베타플러스
            ttt.Remove("172580");   //하이골드12호
            ttt.Remove("174350");   //TIGER로우볼
            ttt.Remove("174360");   //KStar중국본토대형주CSI100
            ttt.Remove("176710");   //파워국고채
            ttt.Remove("181450");   //KINDEX선진국하이일드(합성H)
            ttt.Remove("181480");   //KINDEX미국리츠부동산(합성H)
            ttt.Remove("182480");   //TIGERUS리츠(합성H)
            ttt.Remove("182490");   //TIGER단기선진하이일드(합성H)
            ttt.Remove("183700");   //KStar채권혼합
            ttt.Remove("183710");   //KStar주식혼합
            ttt.Remove("189400");   //ARIRANGAC월드(합성H)
            ttt.Remove("190150");   //ARIRANG바벨채권
            ttt.Remove("190160");   //ARIRANG단기유동성
            ttt.Remove("190620");   //KINDEX단기자금
            ttt.Remove("192090");   //TIGER차이나A300
            ttt.Remove("192720");   //파워고배당저변동성
            ttt.Remove("195920");   //TIGER일본(합성H)
            ttt.Remove("195930");   //TIGER유로스탁스50(합성H)
            ttt.Remove("195970");   //ARIRANG선진국(합성H)
            ttt.Remove("195980");   //ARIRANG신흥국(합성H)
            ttt.Remove("196030");   //KINDEX일본레버리지(H)
            ttt.Remove("196220");   //KStar일본레버리지(H)
            ttt.Remove("196230");   //KStar단기통안채
            ttt.Remove("203780");   //TIGER나스닥바이오
            ttt.Remove("204420");   //ARIRANG차이나H레버리지(합성H)
            ttt.Remove("204480");   //TIGER차이나A레버리지(합성)
            ttt.Remove("205720");   //KINDEX일본인버스(합성H)
            ttt.Remove("208470");   //SMARTMSCI선진국(합성H)
            ttt.Remove("210780");   //TIGER코스피고배당
            ttt.Remove("211210");   //마이티코스피고배당
            ttt.Remove("211260");   //KINDEX배당성장
            ttt.Remove("211560");   //TIGER배당성장
            ttt.Remove("213630");   //ARIRANG미국고배당주(합성H)
            ttt.Remove("215620");   //흥국S&P로우볼
            ttt.Remove("217770");   //TIGER원유인버스선물(H)
            ttt.Remove("217780");   //TIGER차이나A인버스(합성)
            ttt.Remove("217790");   //TIGER가격조정
            ttt.Remove("219390");   //KStar미국원유생산기업(합성H)
            ttt.Remove("219900");   //KINDEX중국본토레버리지(합성)
            ttt.Remove("220130");   //SMART중국본토중소형CSI500(합성H)
            ttt.Remove("222170");   //ARIRANGS&P배당성장
            ttt.Remove("222180");   //ARIRANG스마트베타Value
            ttt.Remove("222190");   //ARIRANG스마트베타Momentum
            ttt.Remove("222200");   //ARIRANG스마트베타Quality
            ttt.Remove("225030");   //TIGERS&P500인버스선물(H)
            ttt.Remove("225040");   //TIGERS&P500레버리지(합성H)
            ttt.Remove("225050");   //TIGER유로스탁스레버리지(합성H)
            ttt.Remove("225060");   //TIGER이머징마켓레버리지(합성H)
            ttt.Remove("225130");   //KINDEX골드선물레버리지(합성H)
            ttt.Remove("226380");   //KINDEX한류
            ttt.Remove("226810");   //파워단기채
            ttt.Remove("227540");   //TIGER200건강관리
            ttt.Remove("227550");   //TIGER200산업재
            ttt.Remove("227560");   //TIGER200생활소비재
            ttt.Remove("227570");   //TIGER우량가치
            ttt.Remove("227830");   //ARIRANG코스피
            ttt.Remove("227930");   //KINDEX코스닥150
            ttt.Remove("228790");   //TIGER화장품
            ttt.Remove("228800");   //TIGER여행레저
            ttt.Remove("228810");   //TIGER미디어컨텐츠
            ttt.Remove("228820");   //TIGERKTOP30
            ttt.Remove("232080");   //TIGER코스닥150
            ttt.Remove("232590");   //KINDEX골드선물인버스2X(합성H)
            ttt.Remove("233160");   //TIGER코스닥150레버리지
            ttt.Remove("234310");   //KStarV&S셀렉트밸류
            ttt.Remove("234790");   //KINDEX코스닥150레버리지
            ttt.Remove("236460");   //ARIRANG스마트베타LowVOL
            ttt.Remove("237440");   //TIGER경기방어채권혼합
            ttt.Remove("238670");   //ARIRANG스마트베타Quality채권혼합
            ttt.Remove("500007");   //신한인버스은선물ETN(H)
            ttt.Remove("500001");   //신한K200USD선물바이셀ETN
            ttt.Remove("500002");   //신한USDK200선물바이셀ETN
            ttt.Remove("500003");   //신한인버스WTI원유선물ETN(H)
            ttt.Remove("500004");   //신한브렌트원유선물ETN(H)
            ttt.Remove("500005");   //신한인버스브렌트원유선물ETN(H)
            ttt.Remove("500006");   //신한인버스금선물ETN(H)
            ttt.Remove("500008");   //신한인버스구리선물ETN(H)
            ttt.Remove("500009");   //신한다우존스지수선물ETN(H)
            ttt.Remove("500010");   //신한인버스다우존스지수선물ETN(H)
            ttt.Remove("500011");   //신한달러인덱스선물ETN(H)
            ttt.Remove("500012");   //신한인버스달러인덱스선물ETN(H)
            ttt.Remove("500013");   //신한옥수수선물ETN(H)
            ttt.Remove("500014");   //신한인버스옥수수선물ETN(H)
            ttt.Remove("500015");   //신한WTI원유선물ETN(H)
            ttt.Remove("500016");   //신한금선물ETN(H)
            ttt.Remove("500017");   //신한은선물ETN(H)
            ttt.Remove("500018");   //신한구리선물ETN(H)
            ttt.Remove("500019");   //신한레버리지WTI원유선물ETN(H)
            ttt.Remove("520001");   //대우로우볼ETN
            ttt.Remove("520004");   //대우전기전자Core5ETN
            ttt.Remove("520005");   //대우인버스전기전자Core5ETN
            ttt.Remove("520006");   //대우에너지화학Core5ETN
            ttt.Remove("520007");   //대우인버스에너지화학Core5ETN
            ttt.Remove("520002");   //대우차이나대표주15ETN(H)
            ttt.Remove("520003");   //대우원자재선물ETN(H)
            ttt.Remove("530003");   //삼성모멘텀탑픽ETN
            ttt.Remove("530004");   //삼성화장품테마주ETN
            ttt.Remove("530005");   //삼성바이오테마주ETN
            ttt.Remove("530006");   //삼성음식료테마주ETN
            ttt.Remove("530007");   //삼성레저테마주ETN
            ttt.Remove("530008");   //삼성미디어테마주ETN
            ttt.Remove("530009");   //삼성증권테마주ETN
            ttt.Remove("530010");   //삼성건축자재테마주ETN
            ttt.Remove("530011");   //삼성온라인쇼핑테마주ETN
            ttt.Remove("530012");   //삼성화학테마주ETN
            ttt.Remove("530013");   //삼성KTOP30ETN
            ttt.Remove("530015");   //삼성미국대형성장주ETN(H)
            ttt.Remove("530016");   //삼성미국대형가치주ETN(H)
            ttt.Remove("530017");   //삼성미국중소형성장주ETN(H)
            ttt.Remove("530018");   //삼성미국중소형가치주ETN(H)
            ttt.Remove("530019");   //삼성미국대형성장주ETN
            ttt.Remove("530020");   //삼성미국대형가치주ETN
            ttt.Remove("530021");   //삼성미국중소형성장주ETN
            ttt.Remove("530022");   //삼성미국중소형가치주ETN
            ttt.Remove("530001");   //삼성유럽고배당주식ETN(H)
            ttt.Remove("530002");   //삼성인버스ChinaA50선물ETN(H)
            ttt.Remove("530014");   //삼성ChinaA50선물ETN(H)
            ttt.Remove("550001");   //QVBigVolETN
            ttt.Remove("550002");   //QVWISE배당ETN
            ttt.Remove("550003");   //QV스마트리밸런싱250/3ETN
            ttt.Remove("550004");   //QV롱숏K150매수로우볼매도ETN
            ttt.Remove("550005");   //QV에너지TOP5ETN
            ttt.Remove("550006");   //QV내수소비TOP5ETN
            ttt.Remove("550007");   //QV조선TOP5ETN
            ttt.Remove("550008");   //QV소프트웨어TOP5ETN
            ttt.Remove("550009");   //QV하드웨어TOP5ETN
            ttt.Remove("550010");   //QV운송TOP5ETN
            ttt.Remove("550011");   //QV자동차TOP5ETN
            ttt.Remove("550012");   //QV의료TOP5ETN
            ttt.Remove("550013");   //QV화학TOP5ETN
            ttt.Remove("550014");   //QV바이오TOP5ETN
            ttt.Remove("550015");   //QV제약TOP5ETN
            ttt.Remove("550016");   //QV건설TOP5ETN
            ttt.Remove("550018");   //QVCHINEXTETN(H)
            ttt.Remove("570001");   //TRUE코스피선물매수콜매도ETN
            ttt.Remove("570002");   //TRUE코스피선물매도풋매도ETN
            ttt.Remove("570003");   //TRUE빅5동일가중ETN
            ttt.Remove("570005");   //TRUE목표변동성20코스피선물ETN
            ttt.Remove("570008");   //TRUE섹터탑픽ETN
            ttt.Remove("570009");   //TRUE코리아프리미어ETN
            ttt.Remove("570004");   //TRUE인버스유로스탁스50ETN(H)
            ttt.Remove("570007");   //TRUE위안화중국5년국채ETN
            ttt.Remove("570006");   //TRUE인버스차이나HETN(H)
            ttt.Remove("580001");   //able코스피200선물플러스ETN
            ttt.Remove("580002");   //ableQuant비중조절ETN
            ttt.Remove("580003");   //ableMonthlyBest11ETN
            ttt.Remove("580004");   //ableKQMonthlyBest11ETN
            ttt.Remove("580005");   //able우량주MonthlyBest11ETN
            ttt.Remove("590001");   //미래에셋미국바이백ETN(H)
            ttt.Remove("590002");   //미래에셋일본바이백ETN(H)

            FileLog.PrintF("setStockCodeList222 ttt.count=>" + ttt.Count());
            return(ttt);
        }
Example #7
0
        private void  sendMessageReceived()
        {
            int sendCount = 0;

            OpenApi.Spell.SpellOpt prevTmp = null;
            while (true)
            {
                OpenApi.Spell.SpellOpt tmp;
                while (receivedQueue.TryDequeue(out tmp))
                {
                    FileLog.PrintF("sendMessageReceived");
                    printRunTime(tmp);
                    //이걸 바꿀수가 없네..
                    String ret = tmp.value;
                    String key = tmp.key;

                    if (prevTmp != null)
                    {
                        FileLog.PrintF("prevTmp.sTrCode=" + prevTmp.sTrCode + ",tmp.sTrCode=" + tmp.sTrCode);
                    }


                    if (prevTmp != null && !prevTmp.sTrCode.Equals(tmp.sTrCode))
                    {
                        String tmpPath = Config.GetPath() + prevTmp.GetCheckZipFileName();
                        System.IO.StreamWriter tmpFile = new System.IO.StreamWriter(tmpPath, true);
                        tmpFile.Write(endDateEos);
                        tmpFile.Close();
                    }
                    else if (prevTmp != null && prevTmp.sTrCode.Equals("OPT10059") && prevTmp.sTrCode.Equals(tmp.sTrCode)
                             &&
                             !(prevTmp.priceOrAmount + "_" + prevTmp.buyOrSell).Equals((tmp.priceOrAmount + "_" + tmp.buyOrSell))
                             )
                    {
                        String tmpPath = Config.GetPath() + prevTmp.GetCheckZipFileName();
                        System.IO.StreamWriter tmpFile = new System.IO.StreamWriter(tmpPath, true);
                        tmpFile.Write(endDateEos);
                        tmpFile.Close();
                    }

                    String path = Config.GetPath() + tmp.GetFileName();
                    System.IO.StreamWriter file = new System.IO.StreamWriter(path, true);
                    file.Write(ret.ToString());
                    file.Close();
                    this.DequeueByRunQueue();

                    //멈추는걸 풀기전에.. 하나가 더있어야해..
                    //.nPrevNext 가 2로 넘어오는건 받을게 더 있다는 것이기 때문에..
                    FileLog.PrintF("tmpSpell.isNext()=" + tmp.isNext());
                    if (tmp.isNext() == true)
                    {
                        //주문을 백터에 넣는게 아니고 바로 하기 때문에..
                        //슬립을 주자
                        Thread.Sleep(200);
                        lock (jijs)
                        {
                            FileLog.PrintF("tmpSpell.nPrevNext > 0  tmp.nPrevNext=" + tmp.nPrevNext);
                            FileLog.PrintF("tmpSpell.startDate=" + tmp.startDate);
                            FileLog.PrintF("sendMessageReceived tmp.sTrCode =" + tmp.sTrCode);
                            ReceiveTrDataFactory        rtf = ReceiveTrDataFactory.getClass1Instance();
                            ReceiveTrData.ReceiveTrData rt  = rtf.getReceiveTrData(tmp.sTrCode);
                            int nRet = rt.Run(axKHOpenAPI, tmp);  //연속조회시
                            tmp.startRunTime = DateTime.Now;
                            setCurrentRunSellOpt(tmp);
                            this.EnqueueByRunQueue(tmp);//실행중인 데이터크기를 대충알기위해서2
                        }
                    }
                    else
                    {
                        lock (jijs)
                        {
                            FileLog.PrintF("tmpSpell.nPrevNext == 0  tmp.nPrevNext=" + tmp.nPrevNext);
                            removeSpellDictionary(key);
                            int    position = key.LastIndexOf("|");
                            String key1     = key.Substring(0, position);
                            removeStockCodeDictionary(key1);
                            sendCount++;
                        }
                        setOpt10081(tmp.sTrCode); // ... 3/1쯤 느림  //그런데 이거 없으면 에러남 0.2초 딜레이에서
                    }

                    //처리하고 파일 압축을 위해
                    prevTmp = tmp.ShallowCopy();
                    if (sendCount == GetCntOrderedCodeCount() && iEOS == 1)
                    {
                        String tmpPath = Config.GetPath() + tmp.GetCheckZipFileName();
                        System.IO.StreamWriter tmpFile = new System.IO.StreamWriter(tmpPath, true);
                        tmpFile.Write(endDateEos);
                        tmpFile.Close();
                        iEOS = 0;
                    }

                    FileLog.PrintF("sendMessageReceived [receivedQueue.Count] =" + receivedQueue.Count);
                    FileLog.PrintF("sendMessageReceived [spellDictionary.Count]=" + spellDictionary.Count);
                    FileLog.PrintF("sendMessageReceived [stockCodeDictionary.Count]=" + stockCodeDictionary.Count);
                    FileLog.PrintF("sendMessageReceived [runQueue.Count]=" + runQueue.Count);
                    FileLog.PrintF("sendMessageReceived [sendCount]=" + sendCount);
                    FileLog.PrintF("sendMessageReceived [GetCntOrderedCodeCount]=" + this.GetCntOrderedCodeCount());
                    FileLog.PrintF("sendMessageReceived [GetRanUniqStockCount]=" + this.GetRanUniqStockCount());
                    FileLog.PrintF("sendMessageReceived [orderQueue.Count]=" + orderQueue.Count);
                    FileLog.PrintF("sendMessageReceived [iEOS]=" + iEOS);

                    if (sendCount == orderedCodeCount && iEOS == 1)
                    {
                        //  EOS_CompressZip();
                        //  iEOS = 0;
                    }
                }
                Thread.Sleep(200); //여기는 사실 지연이 없어도 되지않나요??
            }
        }
Example #8
0
 public void setOpt10081(String sTrCode)
 {
     FileLog.PrintF("setOpt10081 sTrCode=>" + sTrCode);
     _evtOpt10081.Set();
 }
Example #9
0
        private void SendDirectDb(List <TB_OPT10085> opt10085_DataList)
        {
            lock (_lockStockList)
            {
                try
                {
                    using (MySqlConnection conn = new MySqlConnection(Config.GetDbConnStr()))
                    {
                        String sql1 = "DELETE FROM opt10085s;";
                        conn.Open();
                        MySqlTransaction tr      = conn.BeginTransaction();
                        String           dayTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                        try
                        {
                            MySqlCommand cmd = new MySqlCommand(sql1, conn, tr);
                            cmd.ExecuteNonQuery();
                            string        sql2         = @"INSERT INTO opt10085s (
date_of_purchase  
,account_number
,stock_code
,stock_name
,current_price  
,purchase_price  
,total_amount_of_purchase 
,possession_quantity 
,today_sell_profit_and_loss 
,today_commission 
,today_tax 
,credit_gubun
,loan_date
,payment_balance 
,sellable_quantity 
,credit_amount 
,credit_interest 
,expiration_date
,valuation_profit_and_loss 
,earnings_rate
,evaluated_price 
,commission 
,buying_commission 
,selling_commission 
,selling_tax 
,will_profit_price 
,not_commission_profit_and_loss 
,not_commission_profit_and_loss_rate
,order_status
,created_at
,updated_at
)
VALUES";
                            String        sql2_1       = @"
(
@구매일자{0}
,@계좌번호{0}
,@종목코드{0}
,@종목명{0}
,@현재가{0}
,@매입가{0}
,@매입금액{0}
,@보유수량{0}
,@당일매도손익{0}
,@당일매매수수료{0}
,@당일매매세금{0}
,@신용구분{0}
,@대출일{0}
,@결제잔고{0}
,@청산가능수량{0}
,@신용금액{0}
,@신용이자{0}
,@만기일{0}
,@평가손익{0}
,@수익률{0}
,@평가금액{0}
,@수수료{0}
,@매입수수료{0}
,@매도수수료{0}
,@매도세금{0}
,@손익분기매입가{0}
,@손익금액{0}
,@손익율{0}
,@주문상태{0}
,@등록날짜{0}
,@업데이트날짜{0}
),";
                            StringBuilder queryBuilder = new StringBuilder(sql2);
                            for (int i = 0; i < opt10085_DataList.Count(); i++)
                            {
                                queryBuilder.AppendFormat(sql2_1, i);
                                //once we're done looping we remove the last ',' and replace it with a ';'
                                if (i == opt10085_DataList.Count() - 1)
                                {
                                    queryBuilder.Replace(',', ';', queryBuilder.Length - 1, 1);
                                }
                            }
                            String sql2_2 = queryBuilder.ToString();
                            FileLog.PrintF("SendDirectDb2 sql2_2:" + sql2_2.ToString());
                            cmd.CommandText = sql2_2;
                            for (int i = 0; i < opt10085_DataList.Count(); i++)
                            {
                                cmd.Parameters.AddWithValue("@구매일자" + i, opt10085_DataList[i].purchase_dt);
                                cmd.Parameters.AddWithValue("@계좌번호" + i, opt10085_DataList[i].acct_num);
                                cmd.Parameters.AddWithValue("@종목코드" + i, opt10085_DataList[i].stock_cd);
                                cmd.Parameters.AddWithValue("@현재가" + i, opt10085_DataList[i].curr_amt);
                                cmd.Parameters.AddWithValue("@매입가" + i, opt10085_DataList[i].purchase_amt);
                                cmd.Parameters.AddWithValue("@매입금액" + i, opt10085_DataList[i].tot_purchase_amt);
                                cmd.Parameters.AddWithValue("@보유수량" + i, opt10085_DataList[i].possession_qty);
                                cmd.Parameters.AddWithValue("@당일매도손익" + i, opt10085_DataList[i].today_sell_profit_loss);
                                cmd.Parameters.AddWithValue("@당일매매수수료" + i, opt10085_DataList[i].today_commission);
                                cmd.Parameters.AddWithValue("@당일매매세금" + i, opt10085_DataList[i].today_tax);
                                cmd.Parameters.AddWithValue("@신용구분" + i, opt10085_DataList[i].credit_gubun);
                                cmd.Parameters.AddWithValue("@대출일" + i, opt10085_DataList[i].loan_dt);
                                cmd.Parameters.AddWithValue("@결제잔고" + i, opt10085_DataList[i].payment_balance);
                                cmd.Parameters.AddWithValue("@청산가능수량" + i, opt10085_DataList[i].sellable_qty);
                                cmd.Parameters.AddWithValue("@신용금액" + i, opt10085_DataList[i].credit_amt);
                                cmd.Parameters.AddWithValue("@신용이자" + i, opt10085_DataList[i].credit_interest);
                                cmd.Parameters.AddWithValue("@만기일" + i, opt10085_DataList[i].expiry_dt);
                                cmd.Parameters.AddWithValue("@평가손익" + i, opt10085_DataList[i].valuation_profit_loss);
                                cmd.Parameters.AddWithValue("@수익률" + i, opt10085_DataList[i].earnings_rt);
                                cmd.Parameters.AddWithValue("@평가금액" + i, opt10085_DataList[i].evaluated_amt);
                                cmd.Parameters.AddWithValue("@수수료" + i, opt10085_DataList[i].commission);
                                cmd.Parameters.AddWithValue("@매입수수료" + i, opt10085_DataList[i].selling_commission);
                                cmd.Parameters.AddWithValue("@매도수수료" + i, opt10085_DataList[i].buying_commission);
                                cmd.Parameters.AddWithValue("@매도세금" + i, opt10085_DataList[i].selling_tax);
                                cmd.Parameters.AddWithValue("@손익분기매입가" + i, opt10085_DataList[i].will_profit_amt);
                                cmd.Parameters.AddWithValue("@손익금액" + i, opt10085_DataList[i].not_commission_profit_loss);
                                cmd.Parameters.AddWithValue("@손익율" + i, opt10085_DataList[i].profit_loss_rt);
                                cmd.Parameters.AddWithValue("@주문상태" + i, 1);//1 은 보유를 의미
                                cmd.Parameters.AddWithValue("@업데이트날짜" + i, dayTime);
                                cmd.Parameters.AddWithValue("@등록날짜" + i, dayTime);
                            }
                            cmd.ExecuteNonQuery();
                            String sql3 = @"SELECT
DATE_OF_PURCHASE  
,ACCOUNT_NUMBER
,STOCK_CODE
,STOCK_NAME
,CURRENT_PRICE  
,PURCHASE_PRICE  
,TOTAL_AMOUNT_OF_PURCHASE 
,POSSESSION_QUANTITY 
,TODAY_SELL_PROFIT_AND_LOSS 
,TODAY_COMMISSION 
,TODAY_TAX 
,CREDIT_GUBUN
,LOAN_DATE
,PAYMENT_BALANCE 
,SELLABLE_QUANTITY 
,CREDIT_AMOUNT 
,CREDIT_INTEREST 
,EXPIRATION_DATE
,VALUATION_PROFIT_AND_LOSS 
,EARNINGS_RATE
,EVALUATED_PRICE 
,COMMISSION 
,BUYING_COMMISSION 
,SELLING_COMMISSION 
,SELLING_TAX 
,WILL_PROFIT_PRICE 
,NOT_COMMISSION_PROFIT_AND_LOSS 
,NOT_COMMISSION_PROFIT_AND_LOSS_RATE
,ORDER_STATUS
FROM opt10085s
ORDER BY date_of_purchase DESC";
                            cmd.CommandText = sql3;
                            MySqlDataReader rdr = cmd.ExecuteReader();
                            // 다음 레코드 계속 가져와서 루핑
                            while (rdr.Read())
                            {
                                // C# 인덱서를 사용하여
                                // 필드 데이타 엑세스
                                TB_OPT10085 tmp = new TB_OPT10085();
                                tmp.purchase_dt            = rdr["DATE_OF_PURCHASE"].ToString().Trim();
                                tmp.acct_num               = rdr["ACCOUNT_NUMBER"].ToString().Trim();
                                tmp.stock_cd               = rdr["STOCK_CODE"].ToString().Trim();
                                tmp.curr_amt               = int.Parse(rdr["CURRENT_PRICE"].ToString().Trim());
                                tmp.purchase_amt           = int.Parse(rdr["PURCHASE_PRICE"].ToString().Trim());
                                tmp.tot_purchase_amt       = int.Parse(rdr["TOTAL_AMOUNT_OF_PURCHASE"].ToString().Trim());
                                tmp.possession_qty         = int.Parse(rdr["POSSESSION_QUANTITY"].ToString().Trim());
                                tmp.today_sell_profit_loss = int.Parse(rdr["TODAY_SELL_PROFIT_AND_LOSS"].ToString().Trim());
                                tmp.today_commission       = int.Parse(rdr["TODAY_COMMISSION"].ToString().Trim());
                                tmp.today_tax              = int.Parse(rdr["TODAY_TAX"].ToString().Trim());
                                tmp.credit_gubun           = rdr["CREDIT_GUBUN"].ToString().Trim();
                                tmp.loan_dt                    = rdr["LOAN_DATE"].ToString().Trim();
                                tmp.payment_balance            = int.Parse(rdr["PAYMENT_BALANCE"].ToString().Trim());
                                tmp.sellable_qty               = int.Parse(rdr["SELLABLE_QUANTITY"].ToString().Trim());
                                tmp.credit_amt                 = int.Parse(rdr["CREDIT_AMOUNT"].ToString().Trim());
                                tmp.credit_interest            = int.Parse(rdr["CREDIT_INTEREST"].ToString().Trim());
                                tmp.expiry_dt                  = rdr["EXPIRATION_DATE"].ToString().Trim();
                                tmp.valuation_profit_loss      = int.Parse(rdr["VALUATION_PROFIT_AND_LOSS"].ToString().Trim());
                                tmp.earnings_rt                = float.Parse(rdr["EARNINGS_RATE"].ToString().Trim());
                                tmp.evaluated_amt              = int.Parse(rdr["EVALUATED_PRICE"].ToString().Trim());
                                tmp.commission                 = int.Parse(rdr["COMMISSION"].ToString().Trim());
                                tmp.selling_commission         = int.Parse(rdr["BUYING_COMMISSION"].ToString().Trim());
                                tmp.buying_commission          = int.Parse(rdr["SELLING_COMMISSION"].ToString().Trim());
                                tmp.selling_tax                = int.Parse(rdr["SELLING_TAX"].ToString().Trim());
                                tmp.will_profit_amt            = int.Parse(rdr["WILL_PROFIT_PRICE"].ToString().Trim());
                                tmp.not_commission_profit_loss = int.Parse(rdr["NOT_COMMISSION_PROFIT_AND_LOSS"].ToString().Trim());
                                tmp.profit_loss_rt             = float.Parse(rdr["NOT_COMMISSION_PROFIT_AND_LOSS_RATE"].ToString().Trim());
                                tmp.order_status               = int.Parse(rdr["ORDER_STATUS"].ToString().Trim());
                                stockList.Add(tmp);
                            }
                            // 사용후 닫음
                            rdr.Close();
                            tr.Commit();
                        } catch (MySqlException ex2) {
                            try
                            {
                                tr.Rollback();
                            }
                            catch (MySqlException ex1)
                            {
                                FileLog.PrintF("SendDirectDb1 Error:" + ex1.ToString());
                            }
                            FileLog.PrintF("SendDirectDb2 Error:" + ex2.ToString());
                        }
                    }
                }
                catch (MySqlException ex3)
                {
                    FileLog.PrintF("SendDirectDb3 Error:" + ex3.ToString());
                }
            }
        }
Example #10
0
        private void autoSale(TB_OPT10085 opt10085_data)
        {
            FileLog.PrintF("autoSale loss_status=>" + loss_status + ",loss_rate=>" + loss_rate + ",종목코드=>" + opt10085_data.stock_cd + ",손익율=>" + opt10085_data.profit_loss_rt + ",주문상태=>" + opt10085_data.order_status);
            //주식체결 정보가 들어와서 주식 현재가가 변동이 있을때 자동 판매로직이 실행됨
            /*손절매*/
            if (loss_status == true)
            {
                if (opt10085_data.profit_loss_rt <= this.loss_rate && opt10085_data.order_status == 1)//주문상태가 1 즉 보여상태이어야한다.
                {
                    if (MyOrder.getClass1Instance().ExistsOrder(opt10085_data.stock_cd) == false)
                    {
                        //매도주문

                        int    nOrderType  = 2;//신규메도
                        String sCode       = opt10085_data.stock_cd;
                        String sScreenNo   = ScreenNumber.getClass1Instance().GetAnyTimeScrNum();
                        int    nQty        = opt10085_data.possession_qty;
                        int    nPrice      = 0;    //일단 시장가매도하자.
                        String sHogaGb     = "03"; //시장가 매도
                        String sOrgOrderNo = "";   //원주문번호는 공백
                        FileLog.PrintF("autoSale sScreenNo=>" + sScreenNo);
                        FileLog.PrintF("autoSale accountNumber=>" + accountNumber);
                        FileLog.PrintF("autoSale nOrderType=>" + nOrderType);
                        FileLog.PrintF("autoSale sCode=>" + sCode);
                        FileLog.PrintF("autoSale nQty=>" + nQty);
                        FileLog.PrintF("autoSale nPrice=>" + nPrice);
                        FileLog.PrintF("autoSale sHogaGb=>" + sHogaGb);
                        FileLog.PrintF("autoSale sOrgOrderNo=>" + sOrgOrderNo);

                        //아 이거 1초에 5번 즉 0.2초 제한이 여기도 있다. ㅠㅠ이렇게 바로 보내면 안된다...
                        int ret = AppLib.getClass1Instance().getAxKHOpenAPIInstance().SendOrder("손절매_매도주문", sScreenNo, accountNumber, nOrderType, sCode, nQty, nPrice, sHogaGb, sOrgOrderNo);
                        FileLog.PrintF("MyStock AutoSale ret=>" + ret);
                        //상태가 하나더 있어야겠다 주문접수를 한상태인거는 다시 매도를 시도하면 안되므로
                        opt10085_data.order_status = 2;
                        dbUpdateOrderStatus(opt10085_data);
                    }
                }
            }
            /*이익실현*/
            if (profit_status == true)
            {
                if (opt10085_data.profit_loss_rt >= this.profit_rate && opt10085_data.order_status == 1) //주문상태가 1 즉 보여상태이어야한다.
                {
                    //매도주문
                    if (MyOrder.getClass1Instance().ExistsOrder(opt10085_data.stock_cd) == false)
                    {
                        int    nOrderType  = 2;//신규메도
                        String sCode       = opt10085_data.stock_cd;
                        int    nQty        = opt10085_data.possession_qty;
                        int    nPrice      = 0;    //일단 시장가매도하자.
                        String sHogaGb     = "03"; //시장가 매도
                        String sOrgOrderNo = "";   //원주문번호는 공백

                        String sScreenNo = ScreenNumber.getClass1Instance().GetAnyTimeScrNum();


                        FileLog.PrintF("autoSale sScreenNo=>" + sScreenNo);
                        FileLog.PrintF("autoSale accountNumber=>" + accountNumber);
                        FileLog.PrintF("autoSale nOrderType=>" + nOrderType);
                        FileLog.PrintF("autoSale sCode=>" + sCode);
                        FileLog.PrintF("autoSale nQty=>" + nQty);
                        FileLog.PrintF("autoSale nPrice=>" + nPrice);
                        FileLog.PrintF("autoSale sHogaGb=>" + sHogaGb);
                        FileLog.PrintF("autoSale sOrgOrderNo=>" + sOrgOrderNo);
                        int ret = AppLib.getClass1Instance().getAxKHOpenAPIInstance().SendOrder("이익매_매도주문", sScreenNo, accountNumber, nOrderType, sCode, nQty, nPrice, sHogaGb, sOrgOrderNo);
                        FileLog.PrintF("MyStock AutoSale ret=>" + ret);
                        opt10085_data.order_status = 2;
                        dbUpdateOrderStatus(opt10085_data);
                    }
                }
            }
        }
Example #11
0
 public static int GetTaxSell(int value)
 {
     FileLog.PrintF("GetTaxSell value=>" + value);
     FileLog.PrintF("GetTaxSell Convert.ToInt32(value * Commission._taxSell)=>" + Convert.ToInt32(value * Commission._taxSell));
     return(Convert.ToInt32(Convert.ToInt32(value * Commission._taxSell)));   //원미만 절삭이라
 }
Example #12
0
        public static void EOS_CompressZip()
        {
            while (true)
            {
                FileLog.PrintF("EOS_CompressZip");
                //1. 주식일봉차트조회
                string zipPath      = Config.GetPath() + "OPT10081_" + AppLib.getClass1Instance().endDateEos + ".zip";
                string zipCheckPath = Config.GetPath() + "OPT10081.dat";
                string ftpCheckPath = Config.GetPath() + "OPT10081_FTP.dat";
                if (File.Exists(zipPath) == false)
                {
                    if (File.Exists(zipCheckPath))
                    {
                        FileLog.PrintF("EOS_CompressZip OPT10081 zipPath=" + zipPath);
                        FileLog.PrintF("EOS_CompressZip OPT10081 zipCheckPath=" + zipCheckPath);
                        CompressZip(zipPath, "OPT10081_", "");
                        DeleteFile(zipPath, "OPT10081_", "");
                        File.Move(zipCheckPath, ftpCheckPath);
                    }
                }
                //2. 일별거래상세요청
                zipPath      = Config.GetPath() + "OPT10015_" + AppLib.getClass1Instance().endDateEos + ".zip";
                zipCheckPath = Config.GetPath() + "OPT10015.dat";
                ftpCheckPath = Config.GetPath() + "OPT10015_FTP.dat";
                if (File.Exists(zipPath) == false)
                {
                    if (File.Exists(zipCheckPath))
                    {
                        FileLog.PrintF("EOS_CompressZip OPT10015 zipPath=" + zipPath);
                        FileLog.PrintF("EOS_CompressZip OPT10015 zipCheckPath=" + zipCheckPath);
                        CompressZip(zipPath, "OPT10015_", "");
                        DeleteFile(zipPath, "OPT10015_", "");
                        File.Move(zipCheckPath, ftpCheckPath);
                    }
                }
                //3. 종목별투자자기관별차트
                zipPath      = Config.GetPath() + "OPT10059_" + AppLib.getClass1Instance().endDateEos + "_1_1.zip";
                zipCheckPath = Config.GetPath() + "OPT10059_1_1.dat";
                ftpCheckPath = Config.GetPath() + "OPT10059_1_1_FTP.dat";
                if (File.Exists(zipPath) == false)
                {
                    if (File.Exists(zipCheckPath))
                    {
                        FileLog.PrintF("EOS_CompressZip OPT10059_1_1 zipPath=" + zipPath);
                        FileLog.PrintF("EOS_CompressZip OPT10059_1_1 zipCheckPath=" + zipCheckPath);
                        CompressZip(zipPath, "OPT10059_", "_1_1");
                        DeleteFile(zipPath, "OPT10059_", "_1_1");
                        File.Move(zipCheckPath, ftpCheckPath);
                    }
                }
                zipPath      = Config.GetPath() + "OPT10059_" + AppLib.getClass1Instance().endDateEos + "_1_2.zip";
                zipCheckPath = Config.GetPath() + "OPT10059_1_2.dat";
                ftpCheckPath = Config.GetPath() + "OPT10059_1_2_FTP.dat";
                if (File.Exists(zipPath) == false)
                {
                    if (File.Exists(zipCheckPath))
                    {
                        FileLog.PrintF("EOS_CompressZip OPT10059_1_2 zipPath=" + zipPath);
                        FileLog.PrintF("EOS_CompressZip OPT10059_1_2 zipCheckPath=" + zipCheckPath);
                        CompressZip(zipPath, "OPT10059_", "_1_2");
                        DeleteFile(zipPath, "OPT10059_", "_1_2");
                        File.Move(zipCheckPath, ftpCheckPath);
                    }
                }
                zipPath      = Config.GetPath() + "OPT10059_" + AppLib.getClass1Instance().endDateEos + "_2_1.zip";
                zipCheckPath = Config.GetPath() + "OPT10059_2_1.dat";
                ftpCheckPath = Config.GetPath() + "OPT10059_2_1_FTP.dat";
                if (File.Exists(zipPath) == false)
                {
                    if (File.Exists(zipCheckPath))
                    {
                        FileLog.PrintF("EOS_CompressZip OPT10059_2_1 zipPath=" + zipPath);
                        FileLog.PrintF("EOS_CompressZip OPT10059_2_1 zipCheckPath=" + zipCheckPath);
                        CompressZip(zipPath, "OPT10059_", "_2_1");
                        DeleteFile(zipPath, "OPT10059_", "_2_1");
                        File.Move(zipCheckPath, ftpCheckPath);
                    }
                }
                zipPath      = Config.GetPath() + "OPT10059_" + AppLib.getClass1Instance().endDateEos + "_2_2.zip";
                zipCheckPath = Config.GetPath() + "OPT10059_2_2.dat";
                ftpCheckPath = Config.GetPath() + "OPT10059_2_2_FTP.dat";
                if (File.Exists(zipPath) == false)
                {
                    if (File.Exists(zipCheckPath))
                    {
                        FileLog.PrintF("EOS_CompressZip OPT10059_2_2 zipPath=" + zipPath);
                        FileLog.PrintF("EOS_CompressZip OPT10059_2_2 zipCheckPath=" + zipCheckPath);
                        CompressZip(zipPath, "OPT10059_", "_2_2");
                        DeleteFile(zipPath, "OPT10059_", "_2_2");
                        File.Move(zipCheckPath, ftpCheckPath);
                    }
                }
                //4. 공매도추이요청
                zipPath      = Config.GetPath() + "OPT10014_" + AppLib.getClass1Instance().endDateEos + ".zip";
                zipCheckPath = Config.GetPath() + "OPT10014.dat";
                ftpCheckPath = Config.GetPath() + "OPT10014_FTP.dat";
                if (File.Exists(zipPath) == false)
                {
                    if (File.Exists(zipCheckPath))
                    {
                        FileLog.PrintF("EOS_CompressZip OPT10014 zipPath=" + zipPath);
                        FileLog.PrintF("EOS_CompressZip OPT10014 zipCheckPath=" + zipCheckPath);
                        CompressZip(zipPath, "OPT10014_", "");
                        DeleteFile(zipPath, "OPT10014_", "");
                        File.Move(zipCheckPath, ftpCheckPath);
                    }
                }

                //5. 주식일봉차트조회요청
                zipPath      = Config.GetPath() + "OPT10080_" + AppLib.getClass1Instance().endDateEos + ".zip";
                zipCheckPath = Config.GetPath() + "OPT10080.dat";
                ftpCheckPath = Config.GetPath() + "OPT10080_FTP.dat";
                if (File.Exists(zipPath) == false)
                {
                    if (File.Exists(zipCheckPath))
                    {
                        FileLog.PrintF("EOS_CompressZip OPT10080 zipPath=" + zipPath);
                        FileLog.PrintF("EOS_CompressZip OPT10080 zipCheckPath=" + zipCheckPath);
                        CompressZip(zipPath, "OPT10080_", "");
                        DeleteFile(zipPath, "OPT10080_", "");
                        File.Move(zipCheckPath, ftpCheckPath);
                    }
                }

                //5. 주식일봉차트조회요청
                zipPath      = Config.GetPath() + "OPT10001_" + AppLib.getClass1Instance().endDateEos + ".zip";
                zipCheckPath = Config.GetPath() + "OPT10001.dat";
                ftpCheckPath = Config.GetPath() + "OPT10001_FTP.dat";
                if (File.Exists(zipPath) == false)
                {
                    if (File.Exists(zipCheckPath))
                    {
                        FileLog.PrintF("EOS_CompressZip OPT10001 zipPath=" + zipPath);
                        FileLog.PrintF("EOS_CompressZip OPT10001 zipCheckPath=" + zipCheckPath);
                        CompressZip(zipPath, "OPT10001_", "");
                        DeleteFile(zipPath, "OPT10001_", "");
                        File.Move(zipCheckPath, ftpCheckPath);
                    }
                }
                Thread.Sleep(300000);//5분이면 압축이 되겠지???
            }
        }