public SweepUnitPOrder(StringPacket sp) { Code = sp.Decode(); ReqCount = sp.DecodeLong(); ReqPrice = sp.DecodeDouble(); ContractedCount = sp.DecodeLong(); _State = sp.Decode(); }
public EOSOutput(StringPacket sp) { try { ID = sp.Decode(); OptionCode = sp.Decode(); ElwCode = sp.Decode(); State = sp.Decode(); SignedOptionCount = sp.DecodeLong(); SignedElwCount = sp.DecodeLong(); PnL = Convert.ToDouble(sp.Decode()); BookValue = Convert.ToDouble(sp.Decode()); Exposure = Convert.ToDouble(sp.Decode()); } catch (System.Exception ex) { logger.Error(ex.ToString()); Util.KillWithNotice(ex.ToString()); } }
void FillElwRemains(String packet) { StringPacket sp = new StringPacket(packet + ":", ":"); String key = sp.Decode(); if (key.CompareTo("종목번호") == 0) { long index = sp.DecodeLong(); String code = sp.Decode(); CodeCount cc = new CodeCount(); cc.Code = code; _elwRemains.Add(index, cc); } else if (key.CompareTo("금일보유수량") == 0) { long index = sp.DecodeLong(); long count = sp.DecodeLong(); _elwRemains[index].Count = count; } }
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()); } }
void FillElwRemains(String packet) { StringPacket sp = new StringPacket(packet + ":", ":"); String key = sp.Decode(); if (key.CompareTo("종목번호") == 0) { long index = sp.DecodeLong(); String code = sp.Decode(); RawPOrderData rpd = new RawPOrderData(); rpd.Code = code; _elwRemains.Add(index, rpd); } else if (key.CompareTo("금일보유수량") == 0) { long index = sp.DecodeLong(); long count = sp.DecodeLong(); _elwRemains[index].ReqCount = count; } else if (key.CompareTo("장부단가") == 0) { long index = sp.DecodeLong(); double price = sp.DecodeDouble(); _elwRemains[index].ReqPrice = price; } }