I am trying to parse a file which has ITCH messages in it:
http://www.nasdaqtrader.com/Trader.aspx?id=DPSpecs_USEquities#TVITCH¬ http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/NQTV-ITCH-V4_1.pdf¬
Each price is represented as a 32bit fixed point number with 18 whole part bits and 14 decimal part bits. (6 whole number digits followed by 4 decimal digits)
e.g.
200,000.0000
110000110101000000 00000000000000
I have had a look at the struct class but this only deals with whole bytes as its for converting from binary encoded c structs.
I have had a look at the decimal.Decimal module but it seems that you can only instantiate it using a string and this assumes that you already have the number in string format.