def group(self, message: ReconMessage, attributes: tuple, *args, **kwargs): message_type: str = message.proto_message.metadata.message_type session_alias = message.proto_message.metadata.id.connection_id.session_alias direction = message.proto_message.metadata.id.direction if session_alias not in ['demo-conn1', 'demo-conn2'] or \ message_type not in ['ExecutionReport']: return if message_type == 'ExecutionReport' and direction != Direction.FIRST: return if message_type == 'ExecutionReport' and message.proto_message.fields[ 'ExecType'].simple_value != 'F': return if message_type == 'ExecutionReport' and \ message.proto_message.fields['TrdMatchID'].simple_value == "": logger.info( f"RULE '{self.get_name()}'. ER with empty TrdMatchID: {message.proto_message}." ) return if session_alias in [ 'demo-conn1', ]: message.group_id = 'ER_FIX01' elif session_alias in ['demo-conn2']: message.group_id = 'ER_FIX02'
def group(self, message: ReconMessage, attributes: tuple, *args, **kwargs): message_type: str = message.proto_message.metadata.message_type if message_type in ['NewOrderSingle', 'OrderCancelRequest', 'OrderCancelReplaceRequest']: message.group_id = Group.REQUEST elif message_type in ['ExecutionReport', 'OrderCancelReject']: message.group_id = Group.RESPONSE
def group(self, message: ReconMessage, attributes: tuple, *args, **kwargs): message_type: str = message.proto_message.metadata.message_type session_alias = message.proto_message.metadata.id.connection_id.session_alias direction = message.proto_message.metadata.id.direction if session_alias not in ['demo-conn1', 'demo-conn2', 'demo-dc1', 'demo-dc2'] or \ message_type not in ['ExecutionReport']: return if message_type == 'ExecutionReport' and direction != Direction.FIRST: return if session_alias in ['demo-conn1', 'demo-conn2']: message.group_id = 'ER_FIX' elif session_alias in ['demo-dc1', 'demo-dc2']: message.group_id = 'ER_DC'
def group(self, message: ReconMessage, attributes: tuple): message_type: str = message.proto_message.metadata.message_type session_alias = message.proto_message.metadata.id.connection_id.session_alias direction = message.proto_message.metadata.id.direction if session_alias not in ['demo-conn1', 'demo-conn2', 'demo_log.txt'] or \ message_type not in ['NewOrderSingle']: return if message_type == 'NewOrderSingle' and \ message.proto_message.fields['SecondaryClOrdID'].simple_value == "": logger.info(f"RULE '{self.get_name()}'. NOS with empty SecondaryClOrdID: {message.proto_message}.") return if session_alias in ['demo-conn1', 'demo-conn2']: message.group_id = 'NOS_CONN' elif session_alias in ['demo_log.txt']: message.group_id = 'NOS_LOG'
def group(self, message: ReconMessage, attributes: tuple): message_type: str = message.proto_message.metadata.message_type session_alias = message.proto_message.metadata.id.connection_id.session_alias direction = message.proto_message.metadata.id.direction if session_alias not in ['demo-conn1', 'security_status.txt'] or \ message_type not in ['SecurityStatus']: return if message_type == 'SecurityStatus' and \ message.proto_message.fields['SecurityStatusReqID'].simple_value == "": logger.info( f"RULE '{self.get_name()}'. SS with empty SecurityStatusReqID: {message.proto_message}." ) return if session_alias in ['demo-conn1', 'demo-conn2']: message.group_id = 'SS_CONN' elif session_alias in ['security_status.txt']: message.group_id = 'SS_LOG'
def group(self, message: ReconMessage, attributes: tuple): message_type: str = message.proto_message.metadata.message_type session_alias = message.proto_message.metadata.id.connection_id.session_alias direction = message.proto_message.metadata.id.direction if session_alias not in self.config.keys() or message_type not in [ 'ExecutionReport' ]: return if message_type == 'ExecutionReport' and direction != Direction.FIRST: return message.group_id = self.config[session_alias]
def group(self, message: ReconMessage, attributes: tuple): message_type: str = message.proto_message.metadata.message_type session_alias = message.proto_message.metadata.id.connection_id.session_alias if message_type not in ['ExecutionReport', 'NewOrderSingle'] or \ session_alias not in ['arfq01fix04', 'arfq01dc04']: return message.group_id = message_type.translate({ord(c): '' for c in string.ascii_lowercase}) message.group_id += '_' + session_alias message.group_info['session_alias'] = session_alias if message_type == 'ExecutionReport': exec_type = message.proto_message.fields['ExecType'].simple_value message.group_id += '_' + exec_type message.group_info['ExecType'] = exec_type
def group(self, message: ReconMessage, attributes: tuple): message_type: str = message.proto_message.metadata.message_type session_alias = message.proto_message.metadata.id.connection_id.session_alias direction = message.proto_message.metadata.id.direction if session_alias not in self.config.keys() or message_type not in [ 'NewOrderSingle' ]: return if message_type == 'NewOrderSingle' and \ message.proto_message.fields['SecondaryClOrdID'].simple_value == "": logger.info( f"RULE '{self.get_name()}'. NOS with empty SecondaryClOrdID: {message.proto_message}." ) return message.group_id = self.config[session_alias]
def group(self, message: ReconMessage, attributes: tuple): message_type: str = message.proto_message.metadata.message_type session_alias = message.proto_message.metadata.id.connection_id.session_alias direction = message.proto_message.metadata.id.direction if session_alias not in self.config.keys(): return if message_type == 'ExecutionReport' and direction != Direction.FIRST \ and message.proto_message.fields['ExecType'].simple_value != 'F': return if message_type == 'ExecutionReport' and \ message.proto_message.fields['TrdMatchID'].simple_value == "": logger.info( f"RULE '{self.get_name()}'. ER with empty TrdMatchID: {message.proto_message}." ) return message.group_id = self.config[session_alias]