Пример #1
0
        public STRUCT_0374(string topic, string content)
        {
            this.topic = topic;
            int offset = 0;

            this.MSG_LENGTH = content.Substring(offset, 4); offset += 4;
            this.MSG_HEADER = content.Substring(offset, 46); offset += 46;
            this.MSG_DUMMY  = content.Substring(offset, 82); offset += 82;
            this.MESSAGE_SEQUENCE_NUMBER = content.Substring(offset, 11); offset += 11;
            this.TRANSACTION_CODE        = content.Substring(offset, 11); offset += 11;
            this.ME_GRP_NO                     = content.Substring(offset, 2); offset += 2;
            this.BOARD_ID                      = content.Substring(offset, 2); offset += 2;
            this.MEMBER_NUMBER                 = content.Substring(offset, 5); offset += 5;
            this.BRANCH_NUMBER                 = content.Substring(offset, 5); offset += 5;
            this.ORDER_IDENTIFICATION          = content.Substring(offset, 10); offset += 10;
            this.ORIGINAL_ORDER_IDENTIFICATION = content.Substring(offset, 10); offset += 10;
            this.ISSUE_CODE                    = content.Substring(offset, 12); offset += 12;
            this.TRADING_NUMBER                = content.Substring(offset, 11); offset += 11;
            this.TRADING_PRICE                 = content.Substring(offset, 11); offset += 11;
            this.TRADING_VOLUMN                = content.Substring(offset, 10); offset += 10;
            this.SESS_ID      = content.Substring(offset, 2); offset += 2;
            this.TRADING_DATE = content.Substring(offset, 8); offset += 8;

            int year  = Int32.Parse(TRADING_DATE.Substring(0, 4));
            int month = Int32.Parse(TRADING_DATE.Substring(4, 2));
            int day   = Int32.Parse(TRADING_DATE.Substring(6, 2));

            this.TRADING_TIME = content.Substring(offset, 9); offset += 9;

            int hours  = Int32.Parse(TRADING_TIME.Substring(0, 2));
            int minute = Int32.Parse(TRADING_TIME.Substring(2, 2));
            int sec    = Int32.Parse(TRADING_TIME.Substring(4, 2));
            int milli  = Int32.Parse(TRADING_TIME.Substring(6, 3));

            DateTime dateTime = new DateTime(year, month, day, hours, minute, sec, milli);

            this.dateTime       = dateTime;
            this.formatDateTime = dateTime.ToString("HH:mm:ss.fff");

            this.THE_NEARBY_MONTH_TRADING_PRICE = content.Substring(offset, 11); offset += 11;
            this.THE_FUTURE_MONTH_TRADING_PRICE = content.Substring(offset, 11); offset += 11;
            this.ASK_BID_TYPE_CODE = content.Substring(offset, 1); offset += 1;
            this.ACCOUNT_NUMBER    = content.Substring(offset, 12); offset += 12;
            this.MARKET_MAKER_ORDER_TYPE_NUMBER = content.Substring(offset, 11); offset += 11;
            this.TRUST_COMPANY_NUMBER           = content.Substring(offset, 5); offset += 5;
            this.SUBSTITUTE_STOCK_CERTIFICATE_ACCOUNT_NUMBER = content.Substring(offset, 12); offset += 12;
            this.MEMBER_USE_AREA = content.Substring(offset, 60); offset += 60;
        }
Пример #2
0
        public STRUCT_0374_0022(int seq, string topic, STRUCT_0374 s1, STRUCT_0022 s2)
        {
            this.seq        = seq;
            this.topic      = topic;
            this.MSG_LENGTH = s1.MSG_LENGTH;
            this.MSG_HEADER = s1.MSG_HEADER;
            this.MSG_DUMMY  = s1.MSG_DUMMY;
            this.MESSAGE_SEQUENCE_NUMBER = s1.MESSAGE_SEQUENCE_NUMBER;
            this.TRANSACTION_CODE        = s1.TRANSACTION_CODE;
            this.ME_GRP_NO                     = s1.ME_GRP_NO;
            this.BOARD_ID                      = s1.BOARD_ID;
            this.MEMBER_NUMBER                 = s1.MEMBER_NUMBER;
            this.BRANCH_NUMBER                 = s1.BRANCH_NUMBER;
            this.ORDER_IDENTIFICATION          = s1.ORDER_IDENTIFICATION;
            this.ORIGINAL_ORDER_IDENTIFICATION = s1.ORIGINAL_ORDER_IDENTIFICATION;
            this.ISSUE_CODE                    = s1.ISSUE_CODE;
            this.TRADING_NUMBER                = s1.TRADING_NUMBER;
            this.TRADING_PRICE                 = s1.TRADING_PRICE;
            this.TRADING_VOLUMN                = s1.TRADING_VOLUMN;
            this.SESS_ID      = s1.SESS_ID;
            this.TRADING_DATE = s1.TRADING_DATE;

            int year  = Int32.Parse(TRADING_DATE.Substring(0, 4));
            int month = Int32.Parse(TRADING_DATE.Substring(4, 2));
            int day   = Int32.Parse(TRADING_DATE.Substring(6, 2));

            this.TRADING_TIME = s1.TRADING_TIME;

            int hours  = Int32.Parse(TRADING_TIME.Substring(0, 2));
            int minute = Int32.Parse(TRADING_TIME.Substring(2, 2));
            int sec    = Int32.Parse(TRADING_TIME.Substring(4, 2));
            int milli  = Int32.Parse(TRADING_TIME.Substring(6, 3));

            DateTime dateTime  = new DateTime(year, month, day, hours, minute, sec, milli);
            DateTime chartTime = new DateTime(year, month, day, hours, minute, 0, 0);

            this.formatDateTime = dateTime.ToString("HH:mm:ss.fff");
            this.chartTime      = chartTime;
            this.dateTime       = dateTime;

            this.THE_NEARBY_MONTH_TRADING_PRICE = s1.THE_NEARBY_MONTH_TRADING_PRICE;
            this.THE_FUTURE_MONTH_TRADING_PRICE = s1.THE_FUTURE_MONTH_TRADING_PRICE;
            this.ASK_BID_TYPE_CODE = s1.ASK_BID_TYPE_CODE;
            this.ACCOUNT_NUMBER    = s1.ACCOUNT_NUMBER;
            this.MARKET_MAKER_ORDER_TYPE_NUMBER = s1.MARKET_MAKER_ORDER_TYPE_NUMBER;
            this.TRUST_COMPANY_NUMBER           = s1.TRUST_COMPANY_NUMBER;
            this.SUBSTITUTE_STOCK_CERTIFICATE_ACCOUNT_NUMBER = s1.SUBSTITUTE_STOCK_CERTIFICATE_ACCOUNT_NUMBER;
            this.MEMBER_USE_AREA = s1.MEMBER_USE_AREA;

            this.MSG_TIME = s2.MSG_TIME;
            int hours2  = Int32.Parse(MSG_TIME.Substring(0, 2));
            int minute2 = Int32.Parse(MSG_TIME.Substring(3, 2));
            int sec2    = Int32.Parse(MSG_TIME.Substring(6, 2));
            int milli2  = Int32.Parse(MSG_TIME.Substring(9, 2));

            DateTime dateTime2 = new DateTime(year, month, day, hours2, minute2, sec2, milli2);

            this.dateTime2       = dateTime2;
            this.formatDateTime2 = dateTime.ToString("HH:mm:ss.fff");
            this.MSG_PLUS        = s2.MSG_PLUS;
            this.MSG_VALUE       = s2.MSG_VALUE;

            this.PRICE = (Double.Parse(TRADING_PRICE) * 100).ToString();
            if (ASK_BID_TYPE_CODE.Equals("1"))
            {
                QTY = "-" + Int32.Parse(TRADING_VOLUMN).ToString();;
            }
            else
            {
                QTY = "+" + Int32.Parse(TRADING_VOLUMN).ToString();
            }
            this.VALUE = MSG_PLUS + Double.Parse(MSG_VALUE).ToString();
        }