Hi
I'm trying to get the prices for this fixed interest future. When I run this code I get the erroe message i the subject line:
-- coding: utf-8 --
# Introduction to request_historical_data. YouTube tutorial https://youtu.be/7jmHRVsRcI0
# Request historical data of other than U.S. equities and handle 'No data permission' and 'No security definition'. YouTube tutorial https://youtu.be/iiRierq6sTU
# Request historical data of FOREX, provided by Interactive Brokers for free. YouTube tutorial https://youtu.be/7jmHRVsRcI0
# If you need help on coding, please consider our well known Rent-a-Coder service. https://ibridgepy.com/rent_a_coder/
def initialize(context):
context.security = superSymbol(secType='FUT', symbol='XT', currency='AUD', exchange='SNFE', primaryExchange='SNFE', multiplier='10000', expiry='20200915')
def handle_data(context, data):
# Method 1: IBridgePy function request_historical_data(str_security, barSize, goBack)
# Users have more controls on this function.
# http://www.ibridgepy.com/ibridgepy-documentation/#request_historical_data
print ('Historical Data of %s' % (str(context.security, ),))
hist = request_historical_data(context.security, '1 day', '5 D')
print(hist)
print(hist.iloc[-1]['close'])
end()
I have tried all sort of parameters but when I use different ones I get a symbol not found error.
Can anyone tell me what the 'magic words' are?
Incidentally, can anyone tell me what the continuose future parameters would be?
Thanks.