vgreg / MeatPy

Market Empirical Analysis Toolbox for Python
BSD 3-Clause "New" or "Revised" License
20 stars 5 forks source link

Messages J and h #3

Closed judmejiabe closed 1 year ago

judmejiabe commented 1 year ago

Is there a reason why message types J and h are excluded from self.keep_messages_types in line 16 of file itch50_message_parser.py? It seems that these messages do not get parsed but they seem to be handled in line 165 of the same file.

Thanks!

vgreg commented 1 year ago

That could be an oversight on my part; these message types were added at a later time IIRC. It possible I forgot to add them to the list of messages to parse. I will look into it.

vgreg commented 1 year ago

After verification, I forgot to add them to that list when they were added to the specification. They are getting parsed (you can't read an ITCH file without parsing every message), but they are not kept in memory afterward.

I will add time to the next update (no time estimate for this!), but in the meantime, you can add them manually in your code by redefining keep_messages_types:

parser = ITCH50MessageParser()
parser.keep_messages_types = b'SAFECXDUBHRYPQINLVWKJh'

with open(sample_dir + 'BX_ITCH_20190530_ALGN.txt', 'rb') as itch_file:
    parser.parse_file(itch_file)