Joel Grunbaum
2022-01-20 128c6d51ec8c70e230dc86b100cb887ba3f0378d
test.py
@@ -6,7 +6,7 @@
import book
import protocol
test = False
test = True
HOST: str = 'sytev070'
if (test):
@@ -45,24 +45,29 @@
    so_far_today = f.read();
    for message in so_far_today:
        protocol.handleMessage(bs, message)
message = {"type": "ADD", "product": "F_THS_APP0119T2230", "price": 99.0,
           "side": "BUY", "volume": 1}
# print(json.dumps(message))
# print(send(message))
print(protocol.send(message))
# printRecoveryLog()
# logAllIncomingMessages()
# print(getInformation())
# wstest()
bs = {}
# bs = {}
# recoverBook(bs)
testRecoverBook(bs)
print(list(bs))
for i in bs:
    print(bs[i].product)
    bs[i].printBook()
    print()
    if (len(bs[i].askSide.levels) > 0):
        print(bs[i].askSide.levels[0])
    if (len(bs[i].bidSide.levels)):
        print(bs[i].bidSide.levels[0])
    print()
# testRecoverBook(bs)
# print(list(bs))
# for i in bs:
#     print(bs[i].product)
#     bs[i].printBook()
#     print()
#     if (len(bs[i].askSide.levels) > 0):
#         print(bs[i].askSide.levels[0])
#     if (len(bs[i].bidSide.levels)):
#         print(bs[i].bidSide.levels[0])
#     print()
# book.testBook()