reqFundamentalData - market cap

13 views
Skip to first unread message

jake.p.z...@gmail.com

unread,
Oct 18, 2017, 2:42:28 PM10/18/17
to IbPy Discuss
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()
Reply all
Reply to author
Forward
0 new messages