I just need to print a given stock's market cap. There is a whole list of fundamental ratios provided, one of which is "MKTCAP"
from ib.opt import ibConnection, message
from ib.ext.Contract import Contract
from ib.ext.TickType import TickType as tt
def fundamental_data_handler(msg):
if (msg.data == "MKTCAP"): -> this obviously isn't right, but trying to figure out correct implementation syntax
print(msg.data)
tws = ibConnection(port=7497, clientId=100)
tws.register(fundamental_data_handler, message.fundamentalData)
tws.connect()