Пример #1
0
        public PairArbEachOutput(StringPacket sp)
        {
            try
            {
                OptionCode = sp.Decode();

                _CallPut = sp.Decode();
                Strike = sp.Decode();

                int liveCount = sp.DecodeInt();

                for (int i = 0; i < liveCount; ++i)
                {
                    _liveSweepUnitOutputs.Add(new PairSweeperOutput(sp));
                }

                int doneCount = sp.DecodeInt();
                for (int i = 0; i < doneCount; ++i)
                {
                    _doneSweepUnitOutputs.Add(new PairSweeperOutput(sp));
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
Пример #2
0
        public ElwArbEachOutput(StringPacket sp)
        {
            try
            {
                OptionCode = sp.Decode();
                int liveCount = sp.DecodeInt();

                for (int i = 0; i < liveCount; ++i)
                {
                    _liveEOSOutput.Add(new EOSOutput(sp));
                }
                int doneCount = sp.DecodeInt();
                for (int i = 0; i < doneCount; ++i)
                {
                    _doneEOSOutput.Add(new EOSOutput(sp));
                }
                int rLiveCount = sp.DecodeInt();
                for (int i = 0; i < rLiveCount; ++i)
                {
                    _rLiveEOSOutput.Add(new EOSOutput(sp));
                }
                int rDoneCount = sp.DecodeInt();
                for (int i = 0; i < rDoneCount; ++i)
                {
                    _rDoneEOSOutput.Add(new EOSOutput(sp));
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
Пример #3
0
        public SweepUnitDataRow(StringPacket sp, int id)
        {
            ID = id;
            Code = sp.Decode();
            Exposure = sp.DecodeDouble();
            _State = sp.Decode();

            int count = sp.DecodeInt();

            Orders = new ArrayList();

            for (int i = 0; i < count; ++i)
            {
                Orders.Add(new SweepUnitPOrder(sp));
            }
        }
Пример #4
0
        void UpdateProductList(StringPacket sp)
        {
            int count = sp.DecodeInt();

            dataGridView1.Rows.Clear();

            for (int i = 0; i < count; ++i)
            {
                String code = sp.Decode();
                String askPrice = sp.Decode();
                String bidPrice = sp.Decode();
                Boolean bLegal = Convert.ToBoolean(sp.Decode());

                int index = dataGridView1.Rows.Add();

                dataGridView1.Rows[index].Cells[0].Value = code;
                dataGridView1.Rows[index].Cells[1].Value = askPrice;
                dataGridView1.Rows[index].Cells[2].Value = bidPrice;
                dataGridView1.Rows[index].Cells[3].Value = bLegal;
            }
        }
Пример #5
0
        public void UpdateModifiedList(StringPacket sp)
        {
            lock (locker)
            {
                int count = sp.DecodeInt();

                _codes.Clear();

                for (int i = 0; i < count; ++i)
                {
                    String code = sp.Decode();
                    _codes.Add(code, code);
                }

                String futureCode = KospiFutureUtil.Ins().KFI.Code;
                _codes.Add(futureCode, futureCode);
            }
        }
Пример #6
0
        public PowerBaseResultData(String rawData, Account.OrderLineType pt, Boolean bReal)
        {
            try
            {
                StringPacket packet = new StringPacket(rawData, "|");
                //0. DT Real
                packet.Decode(); // 1 없애고
                //1. 주문번호
                int tmp주문번호 = packet.DecodeInt(); // 주문 번호

                //2. 주문처리유형
                String tmp주문처리유형 = packet.Decode(); // 주문 처리 유형, 01 접수, 03 확인, 04 일부체결, 05 전량체결

                //3. 계좌번호
                String tmp계좌번호 = packet.Decode().Trim();
                //4. 종목코드
                String tmp종목코드 = packet.Decode().Trim();
                //5. 현물잔고유형코드
                packet.Decode(); // 현물 잔고 유형 코드
                //6. 대출상세분류코드
                packet.Decode(); // 대출 상세 분류 코드
                //7. 대출일
                packet.Decode(); // 대출일
                //8. 매매구분

                long tmp매매구분 = packet.DecodeLong(); // 2은 매수, 1는 매도
                //9. 호가구분
                String tmp호가구분 = packet.Decode(); // 00은 지정가, 03은 시장가, 취소인 경우 ''
                //10, 정정취소가능수량
                long tmp정정취소가능수량 = packet.DecodeLong();
                //11. 주문가격
                double tmp주문가격 = packet.DecodeDouble(); // 주문한 가격
                //12. 주문수량
                long tmp주문수량 = packet.DecodeLong();
                //13. 전체체결수량
                long tmp전체체결수량 = packet.DecodeLong();
                //14. 원주문번호
                long tmp원주문번호 = packet.DecodeLong();
                //15. 원주문미체결수량
                long tmp원주문미체결수량 = packet.DecodeLong();
                //16. 원주문정정취소수량
                long tmp원주문정정취소수량 = packet.DecodeLong();
                //17. 종목코드1
                packet.Decode();
                //18. 매매구분1
                packet.Decode();
                //19. 미결제수량1
                packet.Decode();
                //20. 청산가능수량1
                packet.Decode();
                //21. 종목코드2
                packet.Decode();
                //22. 매매구분2
                packet.Decode();
                //23. 미결제수량2
                packet.Decode();
                //24. 청산가능수량2
                packet.Decode();
                //25. 매입금액1
                packet.Decode();
                //26. 매입금액2
                packet.Decode();
                //27. 매매손익
                packet.Decode();
                //28. 전체매매손익
                packet.Decode();
                //29. 거래단위
                packet.Decode();
                //30. 시간
                packet.Decode();
                //31. 전략코드
                packet.Decode();
                //32. 그룹ID
                packet.Decode();
                //33. 주문회차
                packet.Decode();
                //34. 정상,정정,취소
                String tmp정상_정정_취소 = packet.Decode(); //정상,정정,취소(0:정상,1:정정,2:취소)
                //35. 체결가격
                packet.Decode();
                //36. 체결수량
                packet.Decode();
                //37. 평균단가
                double tmp평균단가 = packet.DecodeDouble();
                //38. 원주문회차번호
                //39. 접속분류코드
                //40. 통신매체코드
                //41. 종목명
                //42. 계좌명
                //43. 비밀번호
                //44. 신용거래코드

                // 지정가 주문이 잘 나간 경우는 호가구분이 00(지정가), 주문처리유형이 01(접수)
                // 지정가 주문이 일부 체결되면 주문처리유형이 04(일부 체결)이 되고 모두 체결이 되면 05(전량 체결)이 됨
                // 취소 주문이 잘 나간 경우는 호가구분이 ''(취소), 주문처리유형이 03(확인), 원주문 미체결수량 0
                // 시장가의 경우 호가구분이 03(시장가), 주문처리유형이 05(전량체결)

                Update(
                    tmp주문번호,
                    tmp주문처리유형,
                    tmp계좌번호,
                    tmp종목코드,
                    tmp정상_정정_취소,
                    tmp매매구분,
                    tmp호가구분,
                    tmp주문가격,
                    tmp주문수량,
                    tmp전체체결수량,
                    tmp원주문번호,
                    tmp원주문미체결수량,
                    tmp원주문정정취소수량,
                    tmp정정취소가능수량,
                    tmp평균단가,
                    pt,
                    bReal);

            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }