Beispiel #1
0
        public void HandlePacket(int packetID, String pbPacket)
        {
            KBHTS hts = null;

            const int kInit_TraceIDRange = -1;

            lock (locker)
            {
                if (_map.ContainsKey(packetID))
                {
                    hts = _map[packetID];
                    // remove는 최종 패킷까지 받거든 할 것
            //                    _map.Remove(packetID);
                }
                else
                {
                    if (packetID == kInit_TraceIDRange)
                    {
                        // 8 byte를 읽는다.
                        InPacket iPacket = new InPacket();
                        iPacket.ForcedEncode(pbPacket);

                        long start = iPacket.DecodeLong(8);
                        long end = iPacket.DecodeLong(8);

                        _startOffset = start;
                        _endOffset = end;
                        this._bInit = true;

                        return;
                    }
                    else
                    {
                        logger.Error("({0}) packet id가 존재하지 않는다.", packetID);
                    }
                }
            }
            if (hts != null)
            {
                hts.HandleTossPacket(packetID, pbPacket);
            }
        }
Beispiel #2
0
        void DecodeAndUpdate_B7_BidAsk(InPacket iPacket)
        {
            try
            {
                //코드: KRA643212WC2 (12)
                String longCode = iPacket.DecodeString(12);

                RawMarketData rmd = GetData(longCode);

                if (rmd == null)
                {
                    rmd = RmdManager.Register(longCode, "", Detail.ProductType.Stock, _rmdDict);
                }

                if (rmd != null)
                {
                    //누적체결수량: 000000000000 (12)
                    iPacket.SkipDecode(12);

                    //매도호가1: 000000570 (9)
                    rmd.AskPrice1 = iPacket.DecodeInt(9);

                    //매수호가1: 000000365 (9)
                    rmd.BidPrice1 = iPacket.DecodeInt(9);

                    //매도호가잔량1: 000000033000 (12)
                    rmd.AskCount1 = iPacket.DecodeLong(12);
                    //매수호가잔량1: 000000031000 (12)
                    rmd.BidCount1 = iPacket.DecodeLong(12);

                    //매도호가2: 000000570 (9)
                    rmd.AskPrice2 = iPacket.DecodeInt(9);

                    //매수호가2: 000000365 (9)
                    rmd.BidPrice2 = iPacket.DecodeInt(9);

                    //매도호가잔량2: 000000033000 (12)
                    rmd.AskCount2 = iPacket.DecodeLong(12);
                    //매수호가잔량2: 000000031000 (12)
                    rmd.BidCount2 = iPacket.DecodeLong(12);

                    //매도호가3: 000000570 (9)
                    rmd.AskPrice3 = iPacket.DecodeInt(9);

                    //매수호가3: 000000365 (9)
                    rmd.BidPrice3 = iPacket.DecodeInt(9);

                    //매도호가잔량3: 000000033000 (12)
                    rmd.AskCount3 = iPacket.DecodeLong(12);
                    //매수호가잔량3: 000000031000 (12)
                    rmd.BidCount3 = iPacket.DecodeLong(12);

                    //매도호가4: 000000570 (9)
                    rmd.AskPrice4 = iPacket.DecodeInt(9);

                    //매수호가4: 000000365 (9)
                    rmd.BidPrice4 = iPacket.DecodeInt(9);

                    //매도호가잔량4: 000000033000 (12)
                    rmd.AskCount4 = iPacket.DecodeLong(12);
                    //매수호가잔량4: 000000031000 (12)
                    rmd.BidCount4 = iPacket.DecodeLong(12);

                    //매도호가5: 000000570 (9)
                    rmd.AskPrice5 = iPacket.DecodeInt(9);

                    //매수호가5: 000000365 (9)
                    rmd.BidPrice5 = iPacket.DecodeInt(9);

                    //매도호가잔량5: 000000033000 (12)
                    rmd.AskCount5 = iPacket.DecodeLong(12);
                    //매수호가잔량5: 000000031000 (12)
                    rmd.BidCount5 = iPacket.DecodeLong(12);

                    rmd.LastUpdatedTime = DateTime.Now;
                    _lastUpdated = DateTime.Now;
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
 void DecodeBody_체결(InPacket iPacket)
 {
     //주문시장코드	X	2
     this.주문시장코드 = iPacket.DecodeString(2);
     //주문유형코드	X	2
     this.주문유형코드 = iPacket.DecodeString(2);
     //계좌번호	X	20
     iPacket.SkipDecode(20);
     //종목번호	X	12
     this.종목번호 = iPacket.DecodeString(12);
     //주문번호	9	10
     this.주문번호 = iPacket.DecodeLong(10);
     //원주문번호	9	10
     this.원주문번호 = iPacket.DecodeLong(10);
     //주문수량	9	16
     this.주문수량 = iPacket.DecodeLong(16);
     //주문가격	9	13
     this.주문가격 = iPacket.DecodeLong(13);
     //체결수량	9	16
     this.체결수량 = iPacket.DecodeLong(16);
     //체결가격	9	16
     this.체결가격 = iPacket.DecodeLong(16);
     //정정확인수량	9	16
     iPacket.SkipDecode(16);
     //정정확인가격	9	13
     iPacket.SkipDecode(13);
     //취소확인수량	9	16
     this.취소확인수량 = iPacket.DecodeLong(16);
     //총매도체결금액(채권)	9	16
     iPacket.SkipDecode(16);
     //총매수체결금액(채권)	9	16
     iPacket.SkipDecode(16);
     //미체결매도수량(종목)	9	16
     iPacket.SkipDecode(16);
     //매도가능수량(종목)	9	16
     iPacket.SkipDecode(16);
     //미체결수량(주문)	9	16
     iPacket.SkipDecode(16);
     //원주문미체결수량	9	16
     this.원주문미체결수량 = iPacket.DecodeLong(16);
     //원주문정정수량	9	16
     iPacket.SkipDecode(16);
     //원주문취소수량	9	16
     this.원주문취소수량 = iPacket.DecodeLong(16);
     //주문금액	9	16
     iPacket.SkipDecode(16);
     //변동수량	9	16
     iPacket.SkipDecode(16);
     //매도수구분	X	1
     this.매도수구분 = iPacket.DecodeString(1);
     //주문거래유형코드	X	2
     //합산구분	X	2
     //거부사유	9	4
     //회원/비회원사번호	9	3
     //계좌명	X	20
     //체결수익율	9	6
     //현금체결금액	9	16
     //대용체결금액	9	16
     //선물연계지점번호	X	3
     //선물계좌번호	X	20
     //선물시장구분	X	1
     //증거금현금율	9	7
     //증거금대용율	9	9
     //체결번호	9	10
 }
        void DecodeHeader(InPacket iPacket)
        {
            //6	전문길이                (AP)  전문길이 제외
            long packetLenWithoutSixBytes = iPacket.DecodeLong(6);
            //1	전문구분                (AP)
            iPacket.SkipDecode(1);
            //1	압축구분           (FEP/PWB)
            iPacket.SkipDecode(1);
            //1	암호화구분         (FEP/PWB)
            iPacket.SkipDecode(1);
            //3	데이터 옵셋        (FEP/PWB)
            iPacket.SkipDecode(3);
            //8	서비스코드          (Client)
            this.ServiceCode = iPacket.DecodeString(8);

            //3	회사번호                (AP)
            iPacket.SkipDecode(3);
            //16	사용자ID            (Client)
            iPacket.SkipDecode(16);
            //2	접속분류코드        (Client)
            iPacket.SkipDecode(2);
            //3	접속채널번호       (FEP/PWB)
            iPacket.SkipDecode(3);
            //9	트랜잭션순차번호   (FEP/PWB)
            iPacket.SkipDecode(9);
            //16	트랜잭션추적ID        (공통)
            iPacket.SkipDecode(16);
            //12	공인IP                  (AP)
            iPacket.SkipDecode(12);
            //12	사설IP              (Client)
            iPacket.SkipDecode(12);
            //3	처리지점 번호(000)      (AP)
            iPacket.SkipDecode(3);
            //3	지점번호     (000)      (AP)
            iPacket.SkipDecode(3);
            //8	단말번호 (매체(3)+화면번호(4)+fi(1)))
            iPacket.SkipDecode(8);
            //1	언어구분            (Client)
            iPacket.SkipDecode(1);
            //9	AP처리시각              (AP)
            iPacket.SkipDecode(9);
            //4	메시지코드(요청시SPACE)
            iPacket.SkipDecode(4);
            //1	출력메시지구분((요청시SPACE)
            iPacket.SkipDecode(1);
            //1	압축요청구분       (FEP/PWB)
            iPacket.SkipDecode(1);
            //4	기능키목록          (Client)
            iPacket.SkipDecode(4);
            //4	요청 레코드 개수    (Client)
            iPacket.SkipDecode(4);
            //2	예외처리           (default)
            iPacket.SkipDecode(2);
            //4	예비영역           (default)
            iPacket.SkipDecode(4);
            //1	연속여부            (Client)
            iPacket.SkipDecode(1);
            //18	연속키              (Client)
            iPacket.SkipDecode(18);
            //2	가변시스템정보길이 (FEP/PWB)
            iPacket.SkipDecode(2);
            //2	가변헤더정보길이   (default)
            iPacket.SkipDecode(2);
            //2	가변메시지길이     (default)
            iPacket.SkipDecode(2);
            //1	KB 가변해더           (공동)
            iPacket.SkipDecode(1);
        }
        void Handle_Elw_A3_Contract(InPacket iPacket)
        {
            try
            {
                //코드: KRA643212WC2 (12)
                String longCode = iPacket.DecodeString(12);

                String shortCode = ElwUtil.ConvertToShortCode(longCode);

                if (MarketDataLogOn)
                {
                    logger.Info("Elw_A3(체결데이터) {0}, A3({1:n0}), B7({2:n0})", shortCode, ++_stock_A3_Count, _stock_B7_Count);
                }

                if (shortCode.Length == 0)
                {
                    return;
                }

                //정규시간외구분코드	1
                //"전일대비(기준가대비) 1
                //전일대비	9
                iPacket.SkipDecode(1 + 1 + 9);

                //체결가격	9
                double curPrice = iPacket.DecodeInt(9);

                //체결수량	10
                long contractCount = iPacket.DecodeLong(10);

                //체결유형코드	2
                //시가	9
                //고가	9
                //저가	9
                //누적체결수량	12
                //누적거래대금	18
                //최종매도매수구분코드	1
                //체결가와1호가일치여부	1
                iPacket.SkipDecode(2 + 9 + 9 + 9 + 12 + 18 + 1 + 1);
                //체결시각	6
                int time = iPacket.DecodeInt(6);
                //LP보유수량	15
                iPacket.SkipDecode(15);

                RawMarketData rmd = GetData(shortCode);

                if (rmd != null)
                {
                    rmd.CurPrice = curPrice;
                    //매도1호가	9
                    rmd.AskPrice1 = iPacket.DecodeInt(9);
                    //매수1호가	9
                    rmd.BidPrice1 = iPacket.DecodeInt(9);

                    rmd.LastUpdatedTime = DateTime.Now;

                    MarketDelayManager.Ins().SetElwLastUpdatedTime(DateTime.Now);

                    if (RMDModifier.Ins().IsOn())
                    {
                        RMDModifier.Ins().UpdateRMD(ref rmd);
                    }
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
        Boolean UpdateBondNormalSmallData(ref InPacket iPacket, String targetCode, String curTimeStringWithFormat)
        {
            //DATA구분	2 - HEADER
            //정보구분	2 - HEADER
            //시장구분	1 - HEADER

            //종목코드	12
            String code = iPacket.DecodeString(12);
            if (targetCode.CompareTo(code) != 0)
            {
                return false;
            }
            String shortCode = code;

            //매도 우선 수익률1	6
            iPacket.SkipDecode(6);
            //매수 우선 수익률1	6
            iPacket.SkipDecode(6);

            //매도 우선 호가1	5
            int askPrice1 = iPacket.DecodeInt(5);
            //매수 우선 호가1	5
            int bidPrice1 = iPacket.DecodeInt(5);
            //매도 우선 호가잔량1	12
            long askCount1 = iPacket.DecodeLong(12);
            //매수 우선 호가잔량1	12
            long bidCount1 = iPacket.DecodeLong(12);

            //매도 우선 수익률2	6
            iPacket.SkipDecode(6);
            //매수 우선 수익률2	6
            iPacket.SkipDecode(6);
            //매도 우선 호가2	5

            int askPrice2 = iPacket.DecodeInt(5);
            //매수 우선 호가2	5
            int bidPrice2 = iPacket.DecodeInt(5);
            //매도 우선 호가잔량2	12
            long askCount2 = iPacket.DecodeLong(12);
            //매수 우선 호가잔량2	12
            long bidCount2 = iPacket.DecodeLong(12);

            //매도 우선 수익률3	6
            iPacket.SkipDecode(6);
            //매수 우선 수익률3	6
            iPacket.SkipDecode(6);

            int askPrice3 = iPacket.DecodeInt(5);
            //매수 우선 호가3	5
            int bidPrice3 = iPacket.DecodeInt(5);
            //매도 우선 호가잔량3	12
            long askCount3 = iPacket.DecodeLong(12);
            //매수 우선 호가잔량3	12
            long bidCount3 = iPacket.DecodeLong(12);

            //매도 우선 수익률4	6
            iPacket.SkipDecode(6);
            //매수 우선 수익률4	6
            iPacket.SkipDecode(6);

            int askPrice4 = iPacket.DecodeInt(5);
            //매수 우선 호가4	5
            int bidPrice4 = iPacket.DecodeInt(5);
            //매도 우선 호가잔량4	12
            long askCount4 = iPacket.DecodeLong(12);
            //매수 우선 호가잔량4	12
            long bidCount4 = iPacket.DecodeLong(12);

            //매도 우선 수익률5	6
            iPacket.SkipDecode(6);
            //매수 우선 수익률5	6
            iPacket.SkipDecode(6);

            int askPrice5 = iPacket.DecodeInt(5);
            //매수 우선 호가5	5
            int bidPrice5 = iPacket.DecodeInt(5);
            //매도 우선 호가잔량5	12
            long askCount5 = iPacket.DecodeLong(12);
            //매수 우선 호가잔량5	12
            long bidCount5 = iPacket.DecodeLong(12);

            //매도 총잔량	12
            iPacket.SkipDecode(12);
            //매수 총잔량	12
            iPacket.SkipDecode(12);
            //소액시장참여여부	1
            int small = iPacket.DecodeInt(1);
            //FILLER	7
            //FF	1

            if (small == 0)
            {
                code += NormalSmallConst.TAIL_NORMAL;
            }
            else if (small == 1)
            {
                code += NormalSmallConst.TAIL_SMALL;
            }
            else
            {
                logger.Error("Unknown small value {0}", small);
                Util.KillWithNotice("Unknown small value");
            }

            RawMarketData rmd = new RawMarketData(code, code, Detail.ProductType.BondSpot);

            rmd.AskPrice1 = (double)askPrice1;
            rmd.AskCount1 = askCount1 * CommonConst._1_000;
            rmd.BidPrice1 = (double)bidPrice1;
            rmd.BidCount1 = bidCount1 * CommonConst._1_000;

            rmd.AskPrice2 = (double)askPrice2;
            rmd.AskCount2 = askCount2 * CommonConst._1_000;
            rmd.BidPrice2 = (double)bidPrice2;
            rmd.BidCount2 = bidCount2 * CommonConst._1_000;

            rmd.AskPrice3 = (double)askPrice3;
            rmd.AskCount3 = askCount3 * CommonConst._1_000;
            rmd.BidPrice3 = (double)bidPrice3;
            rmd.BidCount3 = bidCount3 * CommonConst._1_000;

            rmd.AskPrice4 = (double)askPrice4;
            rmd.AskCount4 = askCount4 * CommonConst._1_000;
            rmd.BidPrice4 = (double)bidPrice4;
            rmd.BidCount4 = bidCount4 * CommonConst._1_000;

            rmd.AskPrice5 = (double)askPrice5;
            rmd.AskCount5 = askCount5 * CommonConst._1_000;
            rmd.BidPrice5 = (double)bidPrice5;
            rmd.BidCount5 = bidCount5 * CommonConst._1_000;

            if (small == 0)
            {
                // Normal
                textBox4.Text = curTimeStringWithFormat;
                textBox5.Text = BondUtil.GetRmdTextFormString(rmd);
            }
            else
            {
                //Small
                textBox11.Text = curTimeStringWithFormat;
                textBox12.Text = BondUtil.GetRmdTextFormString(rmd);
            }
            return true;
        }
        RawMarketData Decode_Contract(InPacket iPacket, String targetCode, DateTime curDateTime)
        {
            try
            {
                //A3
                iPacket.SkipDecode(10); // 시간, 1057523068

                //종목코드	X	12
                //KR4167FC0003
                iPacket.SkipDecode(3);
                String code = iPacket.DecodeString(8);
                if (code != targetCode)
                {
                    return null;
                }
                iPacket.SkipDecode(1);
                //종목SEQ	9	3
                iPacket.SkipDecode(3);
                //현재가격부호	X	1
                iPacket.SkipDecode(1);
                //현재가격	9	8
                double curPrice = ((double)iPacket.DecodeInt(8)) / 100.0;
                //체결수량	9	6
                long contractedCount = iPacket.DecodeLong(6);

                RawMarketData rmd = new RawMarketData(code, Detail.ProductType.Unknown);
                rmd.CurPrice = curPrice;
                rmd.LastUpdatedTime = curDateTime;
                return rmd;
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                ProcessUtil.Kill();
            }
            return null;
        }
        void UpdateBondNormalSmallData(ref InPacket iPacket)
        {
            //DATA구분	2 - HEADER
            //정보구분	2 - HEADER
            //시장구분	1 - HEADER

            //종목코드	12
            String code = iPacket.DecodeString(12);
            String shortCode = code;

            //매도 우선 수익률1	6
            iPacket.SkipDecode(6);
            //매수 우선 수익률1	6
            iPacket.SkipDecode(6);

            //매도 우선 호가1	5
            int askPrice1 = iPacket.DecodeInt(5);
            //매수 우선 호가1	5
            int bidPrice1 = iPacket.DecodeInt(5);
            //매도 우선 호가잔량1	12
            long askCount1 = iPacket.DecodeLong(12);
            //매수 우선 호가잔량1	12
            long bidCount1 = iPacket.DecodeLong(12);

            //매도 우선 수익률2	6
            iPacket.SkipDecode(6);
            //매수 우선 수익률2	6
            iPacket.SkipDecode(6);
            //매도 우선 호가2	5

            int askPrice2 = iPacket.DecodeInt(5);
            //매수 우선 호가2	5
            int bidPrice2 = iPacket.DecodeInt(5);
            //매도 우선 호가잔량2	12
            long askCount2 = iPacket.DecodeLong(12);
            //매수 우선 호가잔량2	12
            long bidCount2 = iPacket.DecodeLong(12);

            //매도 우선 수익률3	6
            iPacket.SkipDecode(6);
            //매수 우선 수익률3	6
            iPacket.SkipDecode(6);

            int askPrice3 = iPacket.DecodeInt(5);
            //매수 우선 호가3	5
            int bidPrice3 = iPacket.DecodeInt(5);
            //매도 우선 호가잔량3	12
            long askCount3 = iPacket.DecodeLong(12);
            //매수 우선 호가잔량3	12
            long bidCount3 = iPacket.DecodeLong(12);

            //매도 우선 수익률4	6
            iPacket.SkipDecode(6);
            //매수 우선 수익률4	6
            iPacket.SkipDecode(6);

            int askPrice4 = iPacket.DecodeInt(5);
            //매수 우선 호가4	5
            int bidPrice4 = iPacket.DecodeInt(5);
            //매도 우선 호가잔량4	12
            long askCount4 = iPacket.DecodeLong(12);
            //매수 우선 호가잔량4	12
            long bidCount4 = iPacket.DecodeLong(12);

            //매도 우선 수익률5	6
            iPacket.SkipDecode(6);
            //매수 우선 수익률5	6
            iPacket.SkipDecode(6);

            int askPrice5 = iPacket.DecodeInt(5);
            //매수 우선 호가5	5
            int bidPrice5 = iPacket.DecodeInt(5);
            //매도 우선 호가잔량5	12
            long askCount5 = iPacket.DecodeLong(12);
            //매수 우선 호가잔량5	12
            long bidCount5 = iPacket.DecodeLong(12);

            //매도 총잔량	12
            iPacket.SkipDecode(12);
            //매수 총잔량	12
            iPacket.SkipDecode(12);
            //소액시장참여여부	1
            int small = iPacket.DecodeInt(1);
            //FILLER	7
            //FF	1

            if (small == 0)
            {
                code += NormalSmallConst.TAIL_NORMAL;
            }
            else if (small == 1)
            {
                code += NormalSmallConst.TAIL_SMALL;
            }
            else
            {
                logger.Error("Unknown small value {0}", small);
                Util.KillWithNotice("Unknown small value");
            }

            RegisterBond(code);

            lock (_bondLock)
            {
                RawMarketData rmd = _bondRmds[code];

                rmd.AskPrice1 = (double)askPrice1;
                rmd.AskCount1 = askCount1 * CommonConst._1_000;
                rmd.BidPrice1 = (double)bidPrice1;
                rmd.BidCount1 = bidCount1 * CommonConst._1_000;

                rmd.AskPrice2 = (double)askPrice2;
                rmd.AskCount2 = askCount2 * CommonConst._1_000;
                rmd.BidPrice2 = (double)bidPrice2;
                rmd.BidCount2 = bidCount2 * CommonConst._1_000;

                rmd.AskPrice3 = (double)askPrice3;
                rmd.AskCount3 = askCount3 * CommonConst._1_000;
                rmd.BidPrice3 = (double)bidPrice3;
                rmd.BidCount3 = bidCount3 * CommonConst._1_000;

                rmd.AskPrice4 = (double)askPrice4;
                rmd.AskCount4 = askCount4 * CommonConst._1_000;
                rmd.BidPrice4 = (double)bidPrice4;
                rmd.BidCount4 = bidCount4 * CommonConst._1_000;

                rmd.AskPrice5 = (double)askPrice5;
                rmd.AskCount5 = askCount5 * CommonConst._1_000;
                rmd.BidPrice5 = (double)bidPrice5;
                rmd.BidCount5 = bidCount5 * CommonConst._1_000;
            }
        }
Beispiel #9
0
        void DecodeAndUpdate_BidAsk(InPacket iPacket)
        {
            try
            {
                //B60161057523068KR4167F9000300740000280 00010578000050 00010577000040 00010576000060 00010575000100 00010574000030000326 00010580000071 00010581000036 00010582000045 00010583000102 000105840000720001800040003000400050002000220007000200030006000410575227?
                iPacket.SkipDecode(10); // 시간, 1057523068

                //종목코드	X	12
                //KR4167F90003
                iPacket.SkipDecode(3);
                String code = iPacket.DecodeString(8);
                iPacket.SkipDecode(1);
                //종목SEQ	9	3
                iPacket.SkipDecode(3);
                //장상태구분코드	X	2
                iPacket.SkipDecode(2);
                //매수총호가잔량	9	6
                long totalBidCount = iPacket.DecodeLong(6);

                //매수1단계부호	X	1
                iPacket.SkipDecode(1);
                //매수1단계우선호가가격	9	8
                double 매수1가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수1단계우선호가잔량	9	6
                long 매수1잔량 = iPacket.DecodeLong(6);

                //매수2단계부호	X	1
                iPacket.SkipDecode(1);
                //매수2단계우선호가가격	9	8
                double 매수2가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수2단계우선호가잔량	9	6
                long 매수2잔량 = iPacket.DecodeLong(6);

                //매수3단계부호	X	1
                iPacket.SkipDecode(1);
                //매수3단계우선호가가격	9	8
                double 매수3가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수3단계우선호가잔량	9	6
                long 매수3잔량 = iPacket.DecodeLong(6);

                //매수4단계부호	X	1
                iPacket.SkipDecode(1);
                //매수4단계우선호가가격	9	8
                double 매수4가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수4단계우선호가잔량	9	6
                long 매수4잔량 = iPacket.DecodeLong(6);

                //매수5단계부호	X	1
                iPacket.SkipDecode(1);
                //매수5단계우선호가가격	9	8
                double 매수5가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수5단계우선호가잔량	9	6
                long 매수5잔량 = iPacket.DecodeLong(6);

                //매도총호가잔량	9	6
                long totalAskCount = iPacket.DecodeLong(6);

                //매도1단계부호	X	1
                iPacket.SkipDecode(1);
                //매도1단계우선호가가격	9	8
                double 매도1가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도1단계우선호가잔량	9	6
                long 매도1잔량 = iPacket.DecodeLong(6);

                //매도2단계부호	X	1
                iPacket.SkipDecode(1);
                //매도2단계우선호가가격	9	8
                double 매도2가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도2단계우선호가잔량	9	6
                long 매도2잔량 = iPacket.DecodeLong(6);

                //매도3단계부호	X	1
                iPacket.SkipDecode(1);
                //매도3단계우선호가가격	9	8
                double 매도3가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도3단계우선호가잔량	9	6
                long 매도3잔량 = iPacket.DecodeLong(6);

                //매도4단계부호	X	1
                iPacket.SkipDecode(1);
                //매도4단계우선호가가격	9	8
                double 매도4가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도4단계우선호가잔량	9	6
                long 매도4잔량 = iPacket.DecodeLong(6);

                //매도5단계부호	X	1
                iPacket.SkipDecode(1);
                //매도5단계우선호가가격	9	8
                double 매도5가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도5단계우선호가잔량	9	6
                long 매도5잔량 = iPacket.DecodeLong(6);

                RawMarketData rmd = GetData(code);

                if (rmd != null)
                {
                    rmd.AskPrice1 = 매도1가격;
                    rmd.BidPrice1 = 매수1가격;
                    rmd.AskCount1 = 매도1잔량;
                    rmd.BidCount1 = 매수1잔량;

                    rmd.AskPrice2 = 매도2가격;
                    rmd.BidPrice2 = 매수2가격;
                    rmd.AskCount2 = 매도2잔량;
                    rmd.BidCount2 = 매수2잔량;

                    rmd.AskPrice3 = 매도3가격;
                    rmd.BidPrice3 = 매수3가격;
                    rmd.AskCount3 = 매도3잔량;
                    rmd.BidCount3 = 매수3잔량;

                    rmd.AskPrice4 = 매도4가격;
                    rmd.BidPrice4 = 매수4가격;
                    rmd.AskCount4 = 매도4잔량;
                    rmd.BidCount4 = 매수4잔량;

                    rmd.AskPrice5 = 매도5가격;
                    rmd.BidPrice5 = 매수5가격;
                    rmd.AskCount5 = 매도5잔량;
                    rmd.BidCount5 = 매수5잔량;

                    rmd.TotalBidCount = totalBidCount;
                    rmd.TotalAskCount = totalAskCount;
                    rmd.LastUpdatedTime = DateTime.Now;

                    _lastUpdated = DateTime.Now;
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
        RawMarketData Decode_BidAskContract(InPacket iPacket, String targetCode, DateTime curDateTime)
        {
            try
            {
                //G7
                iPacket.SkipDecode(10); // 시간, 1057523068

                //종목코드	X	12
                //KR4167FC0003
                iPacket.SkipDecode(3);
                String code = iPacket.DecodeString(8);
                if (code != targetCode)
                {
                    return null;
                }
                iPacket.SkipDecode(1);
                //종목SEQ	9	3
                iPacket.SkipDecode(3);
                //현재가격부호	X	1
                iPacket.SkipDecode(1);
                //현재가격	9	8
                double curPrice = ((double)iPacket.DecodeInt(8)) / 100.0;
                //체결수량	9	6
                long contractedCount = iPacket.DecodeLong(6);
                //체결유형코드	X	2
                iPacket.SkipDecode(2);
                //체결시각	X	8
                iPacket.SkipDecode(8);
                //최근월물의제약정가격	9	8
                iPacket.SkipDecode(8);
                //원월물의제약정가격	9	8
                iPacket.SkipDecode(8);
                //시가부호	X	1
                iPacket.SkipDecode(1);
                //시가	9	8
                iPacket.SkipDecode(8);
                //고가부호	X	1
                iPacket.SkipDecode(1);
                //고가	9	8
                iPacket.SkipDecode(8);
                //저가부호	X	1
                iPacket.SkipDecode(1);
                //저가	9	8
                iPacket.SkipDecode(8);
                //직전가격부호	X	1
                iPacket.SkipDecode(1);
                //직전가격	9	8
                iPacket.SkipDecode(8);
                //누적체결수량	9	7
                iPacket.SkipDecode(7);
                //누적거래대금(단위:원)	9	15
                iPacket.SkipDecode(15);
                //협의대량누적체결수량	9	7
                iPacket.SkipDecode(7);
                //EFP누적체결수량	9	7
                iPacket.SkipDecode(7);
                //장상태구분코드	X	2
                iPacket.SkipDecode(2);

                //매수총호가잔량	9	6
                long totalBidCount = iPacket.DecodeLong(6);

                //매수1단계부호	X	1
                iPacket.SkipDecode(1);
                //매수1단계우선호가가격	9	8
                double 매수1가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수1단계우선호가잔량	9	6
                long 매수1잔량 = iPacket.DecodeLong(6);

                //매수2단계부호	X	1
                iPacket.SkipDecode(1);
                //매수2단계우선호가가격	9	8
                double 매수2가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수2단계우선호가잔량	9	6
                long 매수2잔량 = iPacket.DecodeLong(6);

                //매수3단계부호	X	1
                iPacket.SkipDecode(1);
                //매수3단계우선호가가격	9	8
                double 매수3가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수3단계우선호가잔량	9	6
                long 매수3잔량 = iPacket.DecodeLong(6);

                //매수4단계부호	X	1
                iPacket.SkipDecode(1);
                //매수4단계우선호가가격	9	8
                double 매수4가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수4단계우선호가잔량	9	6
                long 매수4잔량 = iPacket.DecodeLong(6);

                //매수5단계부호	X	1
                iPacket.SkipDecode(1);
                //매수5단계우선호가가격	9	8
                double 매수5가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수5단계우선호가잔량	9	6
                long 매수5잔량 = iPacket.DecodeLong(6);

                //매도총호가잔량	9	6
                long totalAskCount = iPacket.DecodeLong(6);

                //매도1단계부호	X	1
                iPacket.SkipDecode(1);
                //매도1단계우선호가가격	9	8
                double 매도1가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도1단계우선호가잔량	9	6
                long 매도1잔량 = iPacket.DecodeLong(6);

                //매도2단계부호	X	1
                iPacket.SkipDecode(1);
                //매도2단계우선호가가격	9	8
                double 매도2가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도2단계우선호가잔량	9	6
                long 매도2잔량 = iPacket.DecodeLong(6);

                //매도3단계부호	X	1
                iPacket.SkipDecode(1);
                //매도3단계우선호가가격	9	8
                double 매도3가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도3단계우선호가잔량	9	6
                long 매도3잔량 = iPacket.DecodeLong(6);

                //매도4단계부호	X	1
                iPacket.SkipDecode(1);
                //매도4단계우선호가가격	9	8
                double 매도4가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도4단계우선호가잔량	9	6
                long 매도4잔량 = iPacket.DecodeLong(6);

                //매도5단계부호	X	1
                iPacket.SkipDecode(1);
                //매도5단계우선호가가격	9	8
                double 매도5가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도5단계우선호가잔량	9	6
                long 매도5잔량 = iPacket.DecodeLong(6);

                RawMarketData rmd = new RawMarketData(code, Detail.ProductType.Unknown);
                rmd.CurPrice = curPrice;
                rmd.AskPrice1 = 매도1가격;
                rmd.BidPrice1 = 매수1가격;
                rmd.AskCount1 = 매도1잔량;
                rmd.BidCount1 = 매수1잔량;

                rmd.AskPrice2 = 매도2가격;
                rmd.BidPrice2 = 매수2가격;
                rmd.AskCount2 = 매도2잔량;
                rmd.BidCount2 = 매수2잔량;

                rmd.AskPrice3 = 매도3가격;
                rmd.BidPrice3 = 매수3가격;
                rmd.AskCount3 = 매도3잔량;
                rmd.BidCount3 = 매수3잔량;

                rmd.AskPrice4 = 매도4가격;
                rmd.BidPrice4 = 매수4가격;
                rmd.AskCount4 = 매도4잔량;
                rmd.BidCount4 = 매수4잔량;

                rmd.AskPrice5 = 매도5가격;
                rmd.BidPrice5 = 매수5가격;
                rmd.AskCount5 = 매도5잔량;
                rmd.BidCount5 = 매수5잔량;

                rmd.TotalBidCount = totalBidCount;
                rmd.TotalAskCount = totalAskCount;
                rmd.LastUpdatedTime = curDateTime;
                return rmd;
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                ProcessUtil.Kill();
            }
            return null;
        }
Beispiel #11
0
        void DecodeAndUpdate_Contract(InPacket iPacket)
        {
            try
            {
                //A3
                iPacket.SkipDecode(10); // 시간, 1057523068

                //종목코드	X	12
                //KR4167F90003
                iPacket.SkipDecode(3);
                String code = iPacket.DecodeString(8);
                iPacket.SkipDecode(1);
                //종목SEQ	9	3
                iPacket.SkipDecode(3);
                //현재가격부호	X	1
                iPacket.SkipDecode(1);
                //현재가격	9	8
                double curPrice = ((double)iPacket.DecodeInt(8)) / 100.0;
                //체결수량	9	6
                long contractedCount = iPacket.DecodeLong(6);

                RawMarketData rmd = GetData(code);

                if (rmd != null)
                {
                    rmd.CurPrice = curPrice;
                    rmd.LastUpdatedTime = DateTime.Now;

                    _lastUpdated = DateTime.Now;
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
Beispiel #12
0
        void DecodeAndUpdate_BidAskContract(InPacket iPacket)
        {
            try
            {
                //G7
                iPacket.SkipDecode(10); // 시간, 1057523068

                //종목코드	X	12
                //KR4167F90003
                iPacket.SkipDecode(3);
                String code = iPacket.DecodeString(8);
                iPacket.SkipDecode(1);
                //종목SEQ	9	3
                iPacket.SkipDecode(3);
            //현재가격부호	X	1
                iPacket.SkipDecode(1);
            //현재가격	9	8
                double curPrice = ((double)iPacket.DecodeInt(8)) / 100.0;
            //체결수량	9	6
                long contractedCount = iPacket.DecodeLong(6);
            //체결유형코드	X	2
                iPacket.SkipDecode(2);
            //체결시각	X	8
                iPacket.SkipDecode(8);
            //최근월물의제약정가격	9	8
                iPacket.SkipDecode(8);
            //원월물의제약정가격	9	8
                iPacket.SkipDecode(8);
            //시가부호	X	1
                iPacket.SkipDecode(1);
            //시가	9	8
                iPacket.SkipDecode(8);
            //고가부호	X	1
                iPacket.SkipDecode(1);
            //고가	9	8
                iPacket.SkipDecode(8);
            //저가부호	X	1
                iPacket.SkipDecode(1);
            //저가	9	8
                iPacket.SkipDecode(8);
            //직전가격부호	X	1
                iPacket.SkipDecode(1);
            //직전가격	9	8
                iPacket.SkipDecode(8);
            //누적체결수량	9	7
                iPacket.SkipDecode(7);
            //누적거래대금(단위:원)	9	15
                iPacket.SkipDecode(15);
            //협의대량누적체결수량	9	7
                iPacket.SkipDecode(7);
            //EFP누적체결수량	9	7
                iPacket.SkipDecode(7);
            //장상태구분코드	X	2
                iPacket.SkipDecode(2);

                //매수총호가잔량	9	6
                long totalBidCount = iPacket.DecodeLong(6);

                //매수1단계부호	X	1
                iPacket.SkipDecode(1);
                //매수1단계우선호가가격	9	8
                double 매수1가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수1단계우선호가잔량	9	6
                long 매수1잔량 = iPacket.DecodeLong(6);

                //매수2단계부호	X	1
                iPacket.SkipDecode(1);
                //매수2단계우선호가가격	9	8
                double 매수2가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수2단계우선호가잔량	9	6
                long 매수2잔량 = iPacket.DecodeLong(6);

                //매수3단계부호	X	1
                iPacket.SkipDecode(1);
                //매수3단계우선호가가격	9	8
                double 매수3가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수3단계우선호가잔량	9	6
                long 매수3잔량 = iPacket.DecodeLong(6);

                //매수4단계부호	X	1
                iPacket.SkipDecode(1);
                //매수4단계우선호가가격	9	8
                double 매수4가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수4단계우선호가잔량	9	6
                long 매수4잔량 = iPacket.DecodeLong(6);

                //매수5단계부호	X	1
                iPacket.SkipDecode(1);
                //매수5단계우선호가가격	9	8
                double 매수5가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수5단계우선호가잔량	9	6
                long 매수5잔량 = iPacket.DecodeLong(6);

                //매도총호가잔량	9	6
                long totalAskCount = iPacket.DecodeLong(6);

                //매도1단계부호	X	1
                iPacket.SkipDecode(1);
                //매도1단계우선호가가격	9	8
                double 매도1가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도1단계우선호가잔량	9	6
                long 매도1잔량 = iPacket.DecodeLong(6);

                //매도2단계부호	X	1
                iPacket.SkipDecode(1);
                //매도2단계우선호가가격	9	8
                double 매도2가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도2단계우선호가잔량	9	6
                long 매도2잔량 = iPacket.DecodeLong(6);

                //매도3단계부호	X	1
                iPacket.SkipDecode(1);
                //매도3단계우선호가가격	9	8
                double 매도3가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도3단계우선호가잔량	9	6
                long 매도3잔량 = iPacket.DecodeLong(6);

                //매도4단계부호	X	1
                iPacket.SkipDecode(1);
                //매도4단계우선호가가격	9	8
                double 매도4가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도4단계우선호가잔량	9	6
                long 매도4잔량 = iPacket.DecodeLong(6);

                //매도5단계부호	X	1
                iPacket.SkipDecode(1);
                //매도5단계우선호가가격	9	8
                double 매도5가격 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도5단계우선호가잔량	9	6
                long 매도5잔량 = iPacket.DecodeLong(6);

                RawMarketData rmd = GetData(code);

                if (rmd != null)
                {
                    rmd.CurPrice = curPrice;
                    rmd.AskPrice1 = 매도1가격;
                    rmd.BidPrice1 = 매수1가격;
                    rmd.AskCount1 = 매도1잔량;
                    rmd.BidCount1 = 매수1잔량;

                    rmd.AskPrice2 = 매도2가격;
                    rmd.BidPrice2 = 매수2가격;
                    rmd.AskCount2 = 매도2잔량;
                    rmd.BidCount2 = 매수2잔량;

                    rmd.AskPrice3 = 매도3가격;
                    rmd.BidPrice3 = 매수3가격;
                    rmd.AskCount3 = 매도3잔량;
                    rmd.BidCount3 = 매수3잔량;

                    rmd.AskPrice4 = 매도4가격;
                    rmd.BidPrice4 = 매수4가격;
                    rmd.AskCount4 = 매도4잔량;
                    rmd.BidCount4 = 매수4잔량;

                    rmd.AskPrice5 = 매도5가격;
                    rmd.BidPrice5 = 매수5가격;
                    rmd.AskCount5 = 매도5잔량;
                    rmd.BidCount5 = 매수5잔량;

                    rmd.TotalBidCount = totalBidCount;
                    rmd.TotalAskCount = totalAskCount;
                    rmd.LastUpdatedTime = DateTime.Now;

                    _lastUpdated = DateTime.Now;
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
Beispiel #13
0
        void DecodeAndUpdate_FOD1(InPacket iPacket)
        {
            //거래일	9	8
            iPacket.SkipDecode(8);
            //기일물구분	X	2
            String maturity = iPacket.DecodeString(2);
            if (maturity != "SP")
            {
                // Spot이 아니면 그냥 넘어가자
                return;
            }
            //만기일(결제일)	9	8
            iPacket.SkipDecode(8);
            //BID BEST	9	6
            double bidBest = Convert.ToDouble(iPacket.DecodeString(6));
            //OFFER BEST	9	6
            double askBest = Convert.ToDouble(iPacket.DecodeString(6));
            //BID VOLUME	9	6
            long bidCount = iPacket.DecodeLong(6);
            //OFFER VOLUME	9	6
            long askCount = iPacket.DecodeLong(6);

            RawMarketData rmd = GetData(UsdSpotName);

            if (rmd != null)
            {
                rmd.BidPrice1 = bidBest;
                rmd.AskPrice1 = askBest;
                rmd.BidCount1 = bidCount;
                rmd.AskCount1 = askCount;
            }
        }
Beispiel #14
0
        void DecodeAndUpdate_A3_Contract(InPacket iPacket)
        {
            try
            {
                //코드: KRA643212WC2 (12)
                String longCode = iPacket.DecodeString(12);

                //정규시간외구분코드	1
                //"전일대비(기준가대비) 1
                //전일대비	9
                iPacket.SkipDecode(1 + 1 + 9);

                //체결가격	9
                double curPrice = iPacket.DecodeInt(9);

                //체결수량	10
                long contractCount = iPacket.DecodeLong(10);

                //체결유형코드	2
                //시가	9
                //고가	9
                //저가	9
                //누적체결수량	12
                //누적거래대금	18
                //최종매도매수구분코드	1
                //체결가와1호가일치여부	1
                iPacket.SkipDecode(2 + 9 + 9 + 9 + 12 + 18 + 1 + 1);
                //체결시각	6
                int time = iPacket.DecodeInt(6);
                //LP보유수량	15
                iPacket.SkipDecode(15);

                RawMarketData rmd = GetData(longCode);

                if (rmd == null)
                {
                    rmd = RmdManager.Register(longCode, "", Detail.ProductType.Stock, _rmdDict);
                }

                if (rmd != null)
                {
                    rmd.CurPrice = curPrice;
                    //매도1호가	9
                    rmd.AskPrice1 = iPacket.DecodeInt(9);
                    //매수1호가	9
                    rmd.BidPrice1 = iPacket.DecodeInt(9);

                    rmd.LastUpdatedTime = DateTime.Now;

                    _lastUpdated = DateTime.Now;
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
        RawMarketData Decode_BidAsk(InPacket iPacket, String targetCode, DateTime curDateTime)
        {
            try
            {
                //B60161057523068KR4167FC000300740000280 00010578000050 00010577000040 00010576000060 00010575000100 00010574000030000326 00010580000071 00010581000036 00010582000045 00010583000102 000105840000720001800040003000400050002000220007000200030006000410575227?
                iPacket.SkipDecode(10); // 시간, 1057523068

                //종목코드	X	12
                //KR4167FC0003
                iPacket.SkipDecode(3);
                String code = iPacket.DecodeString(8);

                if (code != targetCode)
                {
                    return null;
                }

                iPacket.SkipDecode(1);
                //종목SEQ	9	3
                iPacket.SkipDecode(3);
                //장상태구분코드	X	2
                iPacket.SkipDecode(2);
                //매수총호가잔량	9	6
                long totalBidCount = iPacket.DecodeLong(6);

                //매수1단계부호	X	1
                iPacket.SkipDecode(1);
                //매수1단계우선호가가격	9	8
                double bidPrice1 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수1단계우선호가잔량	9	6
                long bidCount1 = iPacket.DecodeLong(6);

                //매수2단계부호	X	1
                iPacket.SkipDecode(1);
                //매수2단계우선호가가격	9	8
                double BidPrice2 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수2단계우선호가잔량	9	6
                long BidCount2 = iPacket.DecodeLong(6);

                //매수3단계부호	X	1
                iPacket.SkipDecode(1);
                //매수3단계우선호가가격	9	8
                double BidPrice3 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수3단계우선호가잔량	9	6
                long BidCount3 = iPacket.DecodeLong(6);

                //매수4단계부호	X	1
                iPacket.SkipDecode(1);
                //매수4단계우선호가가격	9	8
                double BidPrice4 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수4단계우선호가잔량	9	6
                long BidCount4 = iPacket.DecodeLong(6);

                //매수5단계부호	X	1
                iPacket.SkipDecode(1);
                //매수5단계우선호가가격	9	8
                double BidPrice5 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매수5단계우선호가잔량	9	6
                long BidCount5 = iPacket.DecodeLong(6);

                //매도총호가잔량	9	6
                long totalAskCount = iPacket.DecodeLong(6);

                //매도1단계부호	X	1
                iPacket.SkipDecode(1);
                //매도1단계우선호가가격	9	8
                double AskPrice1 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도1단계우선호가잔량	9	6
                long AskCount1 = iPacket.DecodeLong(6);

                //매도2단계부호	X	1
                iPacket.SkipDecode(1);
                //매도2단계우선호가가격	9	8
                double AskPrice2 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도2단계우선호가잔량	9	6
                long AskCount2 = iPacket.DecodeLong(6);

                //매도3단계부호	X	1
                iPacket.SkipDecode(1);
                //매도3단계우선호가가격	9	8
                double AskPrice3 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도3단계우선호가잔량	9	6
                long AskCount3 = iPacket.DecodeLong(6);

                //매도4단계부호	X	1
                iPacket.SkipDecode(1);
                //매도4단계우선호가가격	9	8
                double AskPrice4 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도4단계우선호가잔량	9	6
                long AskCount4 = iPacket.DecodeLong(6);

                //매도5단계부호	X	1
                iPacket.SkipDecode(1);
                //매도5단계우선호가가격	9	8
                double AskPrice5 = ((double)iPacket.DecodeInt(8)) / 100.0;
                //매도5단계우선호가잔량	9	6
                long AskCount5 = iPacket.DecodeLong(6);

                RawMarketData rmd = new RawMarketData(code, Detail.ProductType.Unknown);

                rmd.AskPrice1 = AskPrice1;
                rmd.BidPrice1 = bidPrice1;
                rmd.AskCount1 = AskCount1;
                rmd.BidCount1 = bidCount1;

                rmd.AskPrice2 = AskPrice2;
                rmd.BidPrice2 = BidPrice2;
                rmd.AskCount2 = AskCount2;
                rmd.BidCount2 = BidCount2;

                rmd.AskPrice3 = AskPrice3;
                rmd.BidPrice3 = BidPrice3;
                rmd.AskCount3 = AskCount3;
                rmd.BidCount3 = BidCount3;

                rmd.AskPrice4 = AskPrice4;
                rmd.BidPrice4 = BidPrice4;
                rmd.AskCount4 = AskCount4;
                rmd.BidCount4 = BidCount4;

                rmd.AskPrice5 = AskPrice5;
                rmd.BidPrice5 = BidPrice5;
                rmd.AskCount5 = AskCount5;
                rmd.BidCount5 = BidCount5;

                rmd.TotalBidCount = totalBidCount;
                rmd.TotalAskCount = totalAskCount;

                rmd.LastUpdatedTime = curDateTime;

                return rmd;
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                ProcessUtil.Kill();
            }
            return null;
        }
        void Handle_Stock_B7_BidAsk(InPacket iPacket)
        {
            try
            {
                //코드: KRA643212WC2 (12)
                String longCode = iPacket.DecodeString(12);

                if (MarketDataLogOn)
                {
                    logger.Info("Stock_B7(호가데이터) {0}, A3({1:n0}), B7({2:n0})", longCode, _stock_A3_Count, ++_stock_B7_Count);
                }

                String shortCode = StockUtil.Ins().LongCodeToShortCode(longCode);

                if (shortCode == null)
                {
                    return;
                }

                RawMarketData rmd = GetData(shortCode);

                if (rmd == null)
                {
                    rmd = Register(shortCode, "", Detail.ProductType.Stock);
                }

                if (rmd != null)
                {
                    //누적체결수량: 000000000000 (12)
                    iPacket.SkipDecode(12);

                    //매도호가1: 000000570 (9)
                    rmd.AskPrice1 = iPacket.DecodeInt(9);

                    //매수호가1: 000000365 (9)
                    rmd.BidPrice1 = iPacket.DecodeInt(9);

                    //매도호가잔량1: 000000033000 (12)
                    rmd.AskCount1 = iPacket.DecodeLong(12);
                    //매수호가잔량1: 000000031000 (12)
                    rmd.BidCount1 = iPacket.DecodeLong(12);

                    //매도호가2: 000000570 (9)
                    rmd.AskPrice2 = iPacket.DecodeInt(9);

                    //매수호가2: 000000365 (9)
                    rmd.BidPrice2 = iPacket.DecodeInt(9);

                    //매도호가잔량2: 000000033000 (12)
                    rmd.AskCount2 = iPacket.DecodeLong(12);
                    //매수호가잔량2: 000000031000 (12)
                    rmd.BidCount2 = iPacket.DecodeLong(12);

                    //매도호가3: 000000570 (9)
                    rmd.AskPrice3 = iPacket.DecodeInt(9);

                    //매수호가3: 000000365 (9)
                    rmd.BidPrice3 = iPacket.DecodeInt(9);

                    //매도호가잔량3: 000000033000 (12)
                    rmd.AskCount3 = iPacket.DecodeLong(12);
                    //매수호가잔량3: 000000031000 (12)
                    rmd.BidCount3 = iPacket.DecodeLong(12);

                    //매도호가4: 000000570 (9)
                    rmd.AskPrice4 = iPacket.DecodeInt(9);

                    //매수호가4: 000000365 (9)
                    rmd.BidPrice4 = iPacket.DecodeInt(9);

                    //매도호가잔량4: 000000033000 (12)
                    rmd.AskCount4 = iPacket.DecodeLong(12);
                    //매수호가잔량4: 000000031000 (12)
                    rmd.BidCount4 = iPacket.DecodeLong(12);

                    //매도호가5: 000000570 (9)
                    rmd.AskPrice5 = iPacket.DecodeInt(9);

                    //매수호가5: 000000365 (9)
                    rmd.BidPrice5 = iPacket.DecodeInt(9);

                    //매도호가잔량5: 000000033000 (12)
                    rmd.AskCount5 = iPacket.DecodeLong(12);
                    //매수호가잔량5: 000000031000 (12)
                    rmd.BidCount5 = iPacket.DecodeLong(12);

                    rmd.LastUpdatedTime = DateTime.Now;
                    MarketDelayManager.Ins().SetStockLastUpdatedTime(DateTime.Now);

                    if (RMDModifier.Ins().IsOn())
                    {
                        RMDModifier.Ins().UpdateRMD(ref rmd);
                    }
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
Beispiel #17
0
        void Handle_Elw_B7_BidAsk(InPacket iPacket)
        {
            try
            {
                //코드: KRA643212WC2 (12)
                String longCode = iPacket.DecodeString(12);

                RawMarketData rmd = GetData(longCode);

                if (rmd != null)
                {
                    //누적체결수량: 000000000000 (12)
                    iPacket.SkipDecode(12);

                    //매도호가1: 000000570 (9)
                    rmd.AskPrice1 = iPacket.DecodeInt(9);

                    //매수호가1: 000000365 (9)
                    rmd.BidPrice1 = iPacket.DecodeInt(9);

                    //매도호가잔량1: 000000033000 (12)
                    rmd.AskCount1 = iPacket.DecodeLong(12);
                    //매수호가잔량1: 000000031000 (12)
                    rmd.BidCount1 = iPacket.DecodeLong(12);

                    //LP 매도호가 잔량1: 000000000000 (12)
                    //LP 매수호가 잔량1: 000000000000 (12)
                    iPacket.SkipDecode(12 + 12);

                    //매도호가2: 000000570 (9)
                    rmd.AskPrice2 = iPacket.DecodeInt(9);

                    //매수호가2: 000000365 (9)
                    rmd.BidPrice2 = iPacket.DecodeInt(9);

                    //매도호가잔량2: 000000033000 (12)
                    rmd.AskCount2 = iPacket.DecodeLong(12);
                    //매수호가잔량2: 000000031000 (12)
                    rmd.BidCount2 = iPacket.DecodeLong(12);

                    //LP 매도호가 잔량2: 000000000000 (12)
                    //LP 매수호가 잔량2: 000000000000 (12)
                    iPacket.SkipDecode(12 + 12);

                    //매도호가3: 000000570 (9)
                    rmd.AskPrice3 = iPacket.DecodeInt(9);

                    //매수호가3: 000000365 (9)
                    rmd.BidPrice3 = iPacket.DecodeInt(9);

                    //매도호가잔량3: 000000033000 (12)
                    rmd.AskCount3 = iPacket.DecodeLong(12);
                    //매수호가잔량3: 000000031000 (12)
                    rmd.BidCount3 = iPacket.DecodeLong(12);

                    //LP 매도호가 잔량3: 000000000000 (12)
                    //LP 매수호가 잔량3: 000000000000 (12)
                    iPacket.SkipDecode(12 + 12);

                    //매도호가4: 000000570 (9)
                    rmd.AskPrice4 = iPacket.DecodeInt(9);

                    //매수호가4: 000000365 (9)
                    rmd.BidPrice4 = iPacket.DecodeInt(9);

                    //매도호가잔량4: 000000033000 (12)
                    rmd.AskCount4 = iPacket.DecodeLong(12);
                    //매수호가잔량4: 000000031000 (12)
                    rmd.BidCount4 = iPacket.DecodeLong(12);

                    //LP 매도호가 잔량4: 000000000000 (12)
                    //LP 매수호가 잔량4: 000000000000 (12)
                    iPacket.SkipDecode(12 + 12);

                    //매도호가5: 000000570 (9)
                    rmd.AskPrice5 = iPacket.DecodeInt(9);

                    //매수호가5: 000000365 (9)
                    rmd.BidPrice5 = iPacket.DecodeInt(9);

                    //매도호가잔량5: 000000033000 (12)
                    rmd.AskCount5 = iPacket.DecodeLong(12);
                    //매수호가잔량5: 000000031000 (12)
                    rmd.BidCount5 = iPacket.DecodeLong(12);

                    //LP 매도호가 잔량5: 000000000000 (12)
                    //LP 매수호가 잔량5: 000000000000 (12)
                    iPacket.SkipDecode(12 + 12);

                    rmd.LastUpdatedTime = DateTime.Now;

                    _lastUpdated = DateTime.Now;
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
        void UpdateBondRetailData(ref InPacket iPacket)
        {
            //DATA구분	2 - HEADER
            //정보구분	2 - HEADER
            //시장구분	1 - HDADER

            //종목코드	12
            String code = iPacket.DecodeString(12);
            String shortCode = code;
            code += NormalSmallConst.TAIL_RETAIL;

            //만기년월	4
            iPacket.SkipDecode(4);

            //소매종류코드	2
            iPacket.SkipDecode(2);

            //매도우선가격1	7
            int askPrice1 = iPacket.DecodeInt(7);

            //매도우선수익률1	11
            iPacket.SkipDecode(11);

            //매도우선수량1	20
            long askCount1 = iPacket.DecodeLong(20);

            //매도우선가격2	7
            int askPrice2 = iPacket.DecodeInt(7);

            //매도우선수익률2	11
            iPacket.SkipDecode(11);

            //매도우선수량2	20
            long askCount2 = iPacket.DecodeLong(20);

            //매도우선가격3	7
            int askPrice3 = iPacket.DecodeInt(7);

            //매도우선수익률3	11
            iPacket.SkipDecode(11);

            //매도우선수량3	20
            long askCount3 = iPacket.DecodeLong(20);

            //매도우선가격4	7
            int askPrice4 = iPacket.DecodeInt(7);

            //매도우선수익률4	11
            iPacket.SkipDecode(11);

            //매도우선수량4	20
            long askCount4 = iPacket.DecodeLong(20);

            //매도우선가격5	7
            int askPrice5 = iPacket.DecodeInt(7);

            //매도우선수익률5	11
            iPacket.SkipDecode(11);

            //매도우선수량5	20
            long askCount5 = iPacket.DecodeLong(20);

            //매수우선가격1	7
            int bidPrice1 = iPacket.DecodeInt(7);

            //매수우선수익률1	11
            iPacket.SkipDecode(11);

            //매수우선수량1	20
            long bidCount1 = iPacket.DecodeLong(20);

            //매수우선가격2	7
            int bidPrice2 = iPacket.DecodeInt(7);

            //매수우선수익률2	11
            iPacket.SkipDecode(11);

            //매수우선수량2	20
            long bidCount2 = iPacket.DecodeLong(20);

            //매수우선가격3	7
            int bidPrice3 = iPacket.DecodeInt(7);

            //매수우선수익률3	11
            iPacket.SkipDecode(11);

            //매수우선수량3	20
            long bidCount3 = iPacket.DecodeLong(20);

            //매수우선가격4	7
            int bidPrice4 = iPacket.DecodeInt(7);

            //매수우선수익률4	11
            iPacket.SkipDecode(11);

            //매수우선수량4	20
            long bidCount4 = iPacket.DecodeLong(20);

            //매수우선가격5	7
            int bidPrice5 = iPacket.DecodeInt(7);

            //매수우선수익률5	11
            iPacket.SkipDecode(11);

            //매수우선수량5	20
            long bidCount5 = iPacket.DecodeLong(20);

            //매도총량	20
            iPacket.SkipDecode(20);

            //매수총량	20
            iPacket.SkipDecode(20);

            //현재가	7
            iPacket.SkipDecode(7);

            //거래량	20
            iPacket.SkipDecode(20);

            //거래대금	20
            iPacket.SkipDecode(20);

            //시가	7
            iPacket.SkipDecode(7);

            //고가	7
            iPacket.SkipDecode(7);

            //저가	7
            iPacket.SkipDecode(7);

            //매매일	8
            iPacket.SkipDecode(8);

            //현재가수익률	11
            iPacket.SkipDecode(11);

            //시가수익률	11
            iPacket.SkipDecode(11);

            //고가수익률	11
            iPacket.SkipDecode(11);

            //저가수익률	11
            iPacket.SkipDecode(11);

            //FILLER	6
            iPacket.SkipDecode(6);

            //FF	1
            iPacket.SkipDecode(1);

            RegisterBond(code);

            lock (_bondLock)
            {

                RawMarketData rmd = _bondRmds[code];

                rmd.AskPrice1 = (double)askPrice1;
                rmd.AskCount1 = askCount1 * CommonConst._1_000;
                rmd.BidPrice1 = (double)bidPrice1;
                rmd.BidCount1 = bidCount1 * CommonConst._1_000;

                rmd.AskPrice2 = (double)askPrice2;
                rmd.AskCount2 = askCount2 * CommonConst._1_000;
                rmd.BidPrice2 = (double)bidPrice2;
                rmd.BidCount2 = bidCount2 * CommonConst._1_000;

                rmd.AskPrice3 = (double)askPrice3;
                rmd.AskCount3 = askCount3 * CommonConst._1_000;
                rmd.BidPrice3 = (double)bidPrice3;
                rmd.BidCount3 = bidCount3 * CommonConst._1_000;

                rmd.AskPrice4 = (double)askPrice4;
                rmd.AskCount4 = askCount4 * CommonConst._1_000;
                rmd.BidPrice4 = (double)bidPrice4;
                rmd.BidCount4 = bidCount4 * CommonConst._1_000;

                rmd.AskPrice5 = (double)askPrice5;
                rmd.AskCount5 = askCount5 * CommonConst._1_000;
                rmd.BidPrice5 = (double)bidPrice5;
                rmd.BidCount5 = bidCount5 * CommonConst._1_000;

            }
        }
        void DecodeBody_주문(InPacket iPacket)
        {
            //주문시장코드	X	2
            this.주문시장코드 = iPacket.DecodeString(2);

            //주문유형코드	X	2
            this.주문유형코드 = iPacket.DecodeString(2);

            //원주문번호	9	10
            this.원주문번호 = iPacket.DecodeLong(10);

            //계좌번호(11)	X	20
            iPacket.SkipDecode(20);

            //종목번호	X	12
            this.종목번호 = iPacket.DecodeString(12);
            //주문수량	9	16
            this.주문수량 = iPacket.DecodeLong(16);
            //주문가격	9	13
            this.주문가격 = iPacket.DecodeLong(13);
            //회원사번호	9	3
            iPacket.SkipDecode(3);
            //수수료징수구분 	9	1
            iPacket.SkipDecode(1);
            //매수일자 	X	8
            iPacket.SkipDecode(8);
            //과세구분 	X	1
            iPacket.SkipDecode(1);
            //소액매매조건	X	1
            iPacket.SkipDecode(1);
            //소액동시매매참여구분	X	1
            iPacket.SkipDecode(1);
            //대행사반대매도구분	X	1
            iPacket.SkipDecode(1);
            //채권종류코드	X	3
            iPacket.SkipDecode(3);
            //선물옵션대용반대매매구분	X	1
            iPacket.SkipDecode(1);
            //선물계좌번호	X	20
            iPacket.SkipDecode(20);
            //선물시장구분	X	1
            iPacket.SkipDecode(1);
            //주문금액	9	16
            iPacket.SkipDecode(16);
            //변동수량	9	16
            iPacket.SkipDecode(16);
            //주문번호	9	10
            this.주문번호 = iPacket.DecodeLong(10);
            //총매도체결금액	9	61
            iPacket.SkipDecode(61);
            //총매수체결금액	9	16
            iPacket.SkipDecode(16);
            //매도체결수량	9	16
            iPacket.SkipDecode(16);
            //미체결매도수량(종목)	9	16
            iPacket.SkipDecode(16);
            //원주문미체결수량	9	16
            this.원주문미체결수량 = iPacket.DecodeLong(16);
            //원주문정정수량	9	16
            this.원주문정정수량 = iPacket.DecodeLong(16);
            //원주문취소수량	9	16
            this.원주문취소수량 = iPacket.DecodeLong(16);
            //비회원사송신번호	9	10
            iPacket.SkipDecode(10);
            //주문가능수량	9	16
            iPacket.SkipDecode(16);
            //사용수량	9	16
            iPacket.SkipDecode(16);
            //주문가능현금	9	16
            iPacket.SkipDecode(16);
            //사용현금	9	16
            iPacket.SkipDecode(16);
            //주문가능대용	9	16
            iPacket.SkipDecode(16);
            //사용대용	9	16
            iPacket.SkipDecode(16);
            //매도수구분	X	1
            this.매도수구분 = iPacket.DecodeString(1);
        }
        void Handle_Elw_B7_BidAsk(InPacket iPacket)
        {
            try
            {
                //코드: KRA643212WC2 (12)
                String longCode = iPacket.DecodeString(12);

                String shortCode = ElwUtil.ConvertToShortCode(longCode);

                if (MarketDataLogOn)
                {
                    logger.Info("Elw_B7(호가데이터) {0}, A3({1:n0}), B7({2:n0})", shortCode, _elw_A3_Count, ++_elw_B7_Count);
                }

                if (shortCode.Length == 0)
                {
                    return;
                }

                RawMarketData rmd = GetData(shortCode);

                if (rmd != null)
                {
                    //누적체결수량: 000000000000 (12)
                    iPacket.SkipDecode(12);

                    //매도호가1: 000000570 (9)
                    rmd.AskPrice1 = iPacket.DecodeInt(9);

                    //매수호가1: 000000365 (9)
                    rmd.BidPrice1 = iPacket.DecodeInt(9);

                    //매도호가잔량1: 000000033000 (12)
                    rmd.AskCount1 = iPacket.DecodeLong(12);
                    //매수호가잔량1: 000000031000 (12)
                    rmd.BidCount1 = iPacket.DecodeLong(12);

                    //LP 매도호가 잔량1: 000000000000 (12)
                    //LP 매수호가 잔량1: 000000000000 (12)
                    iPacket.SkipDecode(12 + 12);

                    //매도호가2: 000000570 (9)
                    rmd.AskPrice2 = iPacket.DecodeInt(9);

                    //매수호가2: 000000365 (9)
                    rmd.BidPrice2 = iPacket.DecodeInt(9);

                    //매도호가잔량2: 000000033000 (12)
                    rmd.AskCount2 = iPacket.DecodeLong(12);
                    //매수호가잔량2: 000000031000 (12)
                    rmd.BidCount2 = iPacket.DecodeLong(12);

                    //LP 매도호가 잔량2: 000000000000 (12)
                    //LP 매수호가 잔량2: 000000000000 (12)
                    iPacket.SkipDecode(12 + 12);

                    //매도호가3: 000000570 (9)
                    rmd.AskPrice3 = iPacket.DecodeInt(9);

                    //매수호가3: 000000365 (9)
                    rmd.BidPrice3 = iPacket.DecodeInt(9);

                    //매도호가잔량3: 000000033000 (12)
                    rmd.AskCount3 = iPacket.DecodeLong(12);
                    //매수호가잔량3: 000000031000 (12)
                    rmd.BidCount3 = iPacket.DecodeLong(12);

                    //LP 매도호가 잔량3: 000000000000 (12)
                    //LP 매수호가 잔량3: 000000000000 (12)
                    iPacket.SkipDecode(12 + 12);

                    //매도호가4: 000000570 (9)
                    rmd.AskPrice4 = iPacket.DecodeInt(9);

                    //매수호가4: 000000365 (9)
                    rmd.BidPrice4 = iPacket.DecodeInt(9);

                    //매도호가잔량4: 000000033000 (12)
                    rmd.AskCount4 = iPacket.DecodeLong(12);
                    //매수호가잔량4: 000000031000 (12)
                    rmd.BidCount4 = iPacket.DecodeLong(12);

                    //LP 매도호가 잔량4: 000000000000 (12)
                    //LP 매수호가 잔량4: 000000000000 (12)
                    iPacket.SkipDecode(12 + 12);

                    //매도호가5: 000000570 (9)
                    rmd.AskPrice5 = iPacket.DecodeInt(9);

                    //매수호가5: 000000365 (9)
                    rmd.BidPrice5 = iPacket.DecodeInt(9);

                    //매도호가잔량5: 000000033000 (12)
                    rmd.AskCount5 = iPacket.DecodeLong(12);
                    //매수호가잔량5: 000000031000 (12)
                    rmd.BidCount5 = iPacket.DecodeLong(12);

                    //LP 매도호가 잔량5: 000000000000 (12)
                    //LP 매수호가 잔량5: 000000000000 (12)
                    iPacket.SkipDecode(12 + 12);

                    rmd.LastUpdatedTime = DateTime.Now;
                    MarketDelayManager.Ins().SetElwLastUpdatedTime(DateTime.Now);

                    if (RMDModifier.Ins().IsOn())
                    {
                        RMDModifier.Ins().UpdateRMD(ref rmd);
                    }
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
        Boolean UpdateBondRetailData(ref InPacket iPacket, String targetCode, String curTimeStringWithFormat)
        {
            //DATA구분	2 - HEADER
            //정보구분	2 - HEADER
            //시장구분	1 - HDADER

            //종목코드	12
            String code = iPacket.DecodeString(12);
            if (targetCode.CompareTo(code) != 0)
            {
                return false;
            }
            String shortCode = code;
            code += NormalSmallConst.TAIL_RETAIL;

            //만기년월	4
            iPacket.SkipDecode(4);

            //소매종류코드	2
            iPacket.SkipDecode(2);

            //매도우선가격1	7
            int askPrice1 = iPacket.DecodeInt(7);

            //매도우선수익률1	11
            iPacket.SkipDecode(11);

            //매도우선수량1	20
            long askCount1 = iPacket.DecodeLong(20);

            //매도우선가격2	7
            int askPrice2 = iPacket.DecodeInt(7);

            //매도우선수익률2	11
            iPacket.SkipDecode(11);

            //매도우선수량2	20
            long askCount2 = iPacket.DecodeLong(20);

            //매도우선가격3	7
            int askPrice3 = iPacket.DecodeInt(7);

            //매도우선수익률3	11
            iPacket.SkipDecode(11);

            //매도우선수량3	20
            long askCount3 = iPacket.DecodeLong(20);

            //매도우선가격4	7
            int askPrice4 = iPacket.DecodeInt(7);

            //매도우선수익률4	11
            iPacket.SkipDecode(11);

            //매도우선수량4	20
            long askCount4 = iPacket.DecodeLong(20);

            //매도우선가격5	7
            int askPrice5 = iPacket.DecodeInt(7);

            //매도우선수익률5	11
            iPacket.SkipDecode(11);

            //매도우선수량5	20
            long askCount5 = iPacket.DecodeLong(20);

            //매수우선가격1	7
            int bidPrice1 = iPacket.DecodeInt(7);

            //매수우선수익률1	11
            iPacket.SkipDecode(11);

            //매수우선수량1	20
            long bidCount1 = iPacket.DecodeLong(20);

            //매수우선가격2	7
            int bidPrice2 = iPacket.DecodeInt(7);

            //매수우선수익률2	11
            iPacket.SkipDecode(11);

            //매수우선수량2	20
            long bidCount2 = iPacket.DecodeLong(20);

            //매수우선가격3	7
            int bidPrice3 = iPacket.DecodeInt(7);

            //매수우선수익률3	11
            iPacket.SkipDecode(11);

            //매수우선수량3	20
            long bidCount3 = iPacket.DecodeLong(20);

            //매수우선가격4	7
            int bidPrice4 = iPacket.DecodeInt(7);

            //매수우선수익률4	11
            iPacket.SkipDecode(11);

            //매수우선수량4	20
            long bidCount4 = iPacket.DecodeLong(20);

            //매수우선가격5	7
            int bidPrice5 = iPacket.DecodeInt(7);

            //매수우선수익률5	11
            iPacket.SkipDecode(11);

            //매수우선수량5	20
            long bidCount5 = iPacket.DecodeLong(20);

            //매도총량	20
            iPacket.SkipDecode(20);

            //매수총량	20
            iPacket.SkipDecode(20);

            //현재가	7
            iPacket.SkipDecode(7);

            //거래량	20
            iPacket.SkipDecode(20);

            //거래대금	20
            iPacket.SkipDecode(20);

            //시가	7
            iPacket.SkipDecode(7);

            //고가	7
            iPacket.SkipDecode(7);

            //저가	7
            iPacket.SkipDecode(7);

            //매매일	8
            iPacket.SkipDecode(8);

            //현재가수익률	11
            iPacket.SkipDecode(11);

            //시가수익률	11
            iPacket.SkipDecode(11);

            //고가수익률	11
            iPacket.SkipDecode(11);

            //저가수익률	11
            iPacket.SkipDecode(11);

            //FILLER	6
            iPacket.SkipDecode(6);

            //FF	1
            iPacket.SkipDecode(1);

            RawMarketData rmd = new RawMarketData(code, code, Detail.ProductType.BondSpot);

            rmd.AskPrice1 = (double)askPrice1;
            rmd.AskCount1 = askCount1 * CommonConst._1_000;
            rmd.BidPrice1 = (double)bidPrice1;
            rmd.BidCount1 = bidCount1 * CommonConst._1_000;

            rmd.AskPrice2 = (double)askPrice2;
            rmd.AskCount2 = askCount2 * CommonConst._1_000;
            rmd.BidPrice2 = (double)bidPrice2;
            rmd.BidCount2 = bidCount2 * CommonConst._1_000;

            rmd.AskPrice3 = (double)askPrice3;
            rmd.AskCount3 = askCount3 * CommonConst._1_000;
            rmd.BidPrice3 = (double)bidPrice3;
            rmd.BidCount3 = bidCount3 * CommonConst._1_000;

            rmd.AskPrice4 = (double)askPrice4;
            rmd.AskCount4 = askCount4 * CommonConst._1_000;
            rmd.BidPrice4 = (double)bidPrice4;
            rmd.BidCount4 = bidCount4 * CommonConst._1_000;

            rmd.AskPrice5 = (double)askPrice5;
            rmd.AskCount5 = askCount5 * CommonConst._1_000;
            rmd.BidPrice5 = (double)bidPrice5;
            rmd.BidCount5 = bidCount5 * CommonConst._1_000;

            textBox15.Text = curTimeStringWithFormat;
            textBox16.Text = BondUtil.GetRmdTextFormString(rmd);
            return true;
        }