#Course Name: Automated Trading with IBridgePy using Interactive Brokers Platform, #Section No: 4, Unit No: 1, Unit type: Video
###I have done everything but i am unable to fetch data
def initialize(context):
context.run_once = False
context.security = symbol('AAPL')
def handle_data(context, data):
print(get_datetime().strftime("%Y-%m-%d %H:%M:%S %Z"))
print(data.current(context.security,'price'))
Hi Jayant,
If you are using a demo account, then you will not have access to all tickers. You need to get a data subscription to fetch the necessary data. Your access will be limited to Forex pairs mostly.
Try the below symbol to fetch data.
def initialize(context):
context.security=symbol('CASH,EUR,USD')
Thanks!