I executed the example in help but received, 'pytz.exceptions.UnknownTimeZoneError: '13:30:00'' even after setting the timezone. Full log below. What am I doing wrong?
./src/download_bars.py -p 7497 --timezone 'America/Chicago' --size "1 min" --start-date 20200202 --end-date 20200207 AMGN
23:43:27,531 ibapi.client INFO sent startApi
23:43:27,531 ibapi.client INFO REQUEST startApi {}
23:43:27,532 ibapi.client INFO SENDING startApi b'\x00\x00\x00\x0871\x002\x000\x00\x00'
23:43:27,532 root INFO Connected
23:43:27,533 root INFO Waiting for thread to finish ...
23:43:27,540 ibapi.wrapper INFO ANSWER managedAccounts {'accountsList': ','}
23:43:27,547 ibapi.wrapper INFO ANSWER nextValidId {'orderId': 1}
23:43:27,547 root INFO nextValidId: 1
23:43:27,548 ibapi.client INFO REQUEST reqContractDetails {'reqId': 1, 'contract': 140680240270976: 0,AMGN,STK,,0.0,,,SMART,,USD,,,False,,combo:}
23:43:27,548 ibapi.client INFO SENDING reqContractDetails b'\x00\x00\x00)9\x008\x001\x000\x00AMGN\x00STK\x00\x000.0\x00\x00\x00SMART\x00\x00USD\x00\x00\x000\x00\x00\x00'
23:43:27,549 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:uscrypto'}
23:43:27,549 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:uscrypto
23:43:27,550 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:usfuture.nj'}
23:43:27,550 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:usfuture.nj
23:43:27,550 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:hfarm'}
23:43:27,550 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:hfarm
23:43:27,550 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:usfarm.nj'}
23:43:27,551 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:usfarm.nj
23:43:27,551 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:jfarm'}
23:43:27,551 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:jfarm
23:43:27,551 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:cashfarm'}
23:43:27,551 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:cashfarm
23:43:27,552 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:eufarmnj'}
23:43:27,552 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:eufarmnj
23:43:27,552 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:usfarm'}
23:43:27,552 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:usfarm
23:43:27,552 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:euhmds'}
23:43:27,553 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:euhmds
23:43:27,553 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:cashhmds'}
23:43:27,553 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:cashhmds
23:43:27,553 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:fundfarm'}
23:43:27,553 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:fundfarm
23:43:27,554 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:ushmds'}
23:43:27,554 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:ushmds
23:43:27,554 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2158, 'errorString': 'Sec-def data farm connection is OK:secdefil'}
23:43:27,554 ibapi.wrapper ERROR ERROR -1 2158 Sec-def data farm connection is OK:secdefil
23:43:27,656 ibapi.wrapper INFO ANSWER contractDetails {'reqId': 1, 'contractDetails': 140680240269584: 266145,AMGN,STK,,0.0,,,SMART,NASDAQ,USD,AMGN,NMS,False,,combo:,NMS,0.01,ACTIVETIM,AD,ADJUST,ALERT,ALGO,ALLOC,AON,AVGCOST,BASKET,BENCHPX,CASHQTY,COND,CONDORDER,DARKONLY,DARKPOLL,DAY,DEACT,DEACTDIS,DEACTEOD,DIS,DUR,GAT,GTC,GTD,GTT,HID,IBKRATS,ICE,IMB,IOC,LIT,LMT,LOC,MIDPX,MIT,MKT,MOC,MTL,NGCOMB,NODARK,NONALGO,OCA,OPG,OPGREROUT,PEGBENCH,PEGMID,POSTATS,POSTONLY,PREOPGRTH,PRICECHK,REL,REL2MID,RELPCTOFS,RPI,RTH,SCALE,SCALEODD,SCALERST,SIZECHK,SMARTSTG,SNAPMID,SNAPMKT,SNAPREL,STP,STPLMT,SWEEP,TRAIL,TRAILLIT,TRAILLMT,TRAILMIT,WHATIF,SMART,AMEX,NYSE,CBOE,PHLX,ISE,CHX,ARCA,ISLAND,DRCTEDGE,BEX,BATS,EDGEA,CSFBALGO,JEFFALGO,BYX,IEX,EDGX,FOXRIVER,PEARL,NYSENAT,LTSE,MEMX,TPLUS1,PSX,1,0,AMGEN INC,,Consumer, Non-cyclical,Biotechnology,Medical-Biomedical/Gene,US/Eastern,20230326:CLOSED;20230327:0400-20230327:2000;20230328:0400-20230328:2000;20230329:0400-20230329:2000;20230330:0400-20230330:2000;20230331:0400-20230331:2000,20230326:CLOSED;20230327:0930-20230327:1600;20230328:0930-20230328:1600;20230329:0930-20230329:1600;20230330:0930-20230330:1600;20230331:0930-20230331:1600,,0,100,,,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,1,[140680240267952: ISIN=US0311621009;],,COMMON,,,,,,False,False,0,False,,,,,False,}
23:43:27,699 ibapi.client INFO REQUEST reqHeadTimeStamp {'reqId': 2, 'contract': 140680240268240: 266145,AMGN,STK,,0.0,,,SMART,NASDAQ,USD,AMGN,NMS,False,,combo:, 'whatToShow': 'TRADES', 'useRTH': 0, 'formatDate': 1}
23:43:27,699 ibapi.client INFO SENDING reqHeadTimeStamp b'\x00\x00\x00C87\x002\x00266145\x00AMGN\x00STK\x00\x000.0\x00\x00\x00SMART\x00NASDAQ\x00USD\x00AMGN\x00NMS\x000\x000\x00TRADES\x001\x00'
23:43:27,769 ibapi.client INFO disconnecting
23:43:27,769 ibapi.wrapper INFO ANSWER connectionClosed {}
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/ubuntu/DevOps/IBDownload/lib/python3.8/site-packages/ibapi/client.py", line 263, in run
self.decoder.interpret(fields)
File "/home/ubuntu/DevOps/IBDownload/lib/python3.8/site-packages/ibapi/decoder.py", line 1296, in interpret
handleInfo.processMeth(self, iter(fields))
File "/home/ubuntu/DevOps/IBDownload/lib/python3.8/site-packages/ibapi/decoder.py", line 844, in processHeadTimestamp
self.wrapper.headTimestamp(reqId,headTimestamp)
File "./src/download_bars.py", line 198, in headTimestamp
ts = self._parse_timestamp(headTimestamp)
File "./src/download_bars.py", line 191, in _parse_timestamp
tz = pytz.timezone(tokens[-1])
File "/home/ubuntu/DevOps/IBDownload/lib/python3.8/site-packages/pytz/init.py", line 188, in timezone
raise UnknownTimeZoneError(zone)
pytz.exceptions.UnknownTimeZoneError: '13:30:00'
I executed the example in help but received, 'pytz.exceptions.UnknownTimeZoneError: '13:30:00'' even after setting the timezone. Full log below. What am I doing wrong?
./src/download_bars.py -p 7497 --timezone 'America/Chicago' --size "1 min" --start-date 20200202 --end-date 20200207 AMGN 23:43:27,531 ibapi.client INFO sent startApi 23:43:27,531 ibapi.client INFO REQUEST startApi {} 23:43:27,532 ibapi.client INFO SENDING startApi b'\x00\x00\x00\x0871\x002\x000\x00\x00' 23:43:27,532 root INFO Connected 23:43:27,533 root INFO Waiting for thread to finish ... 23:43:27,540 ibapi.wrapper INFO ANSWER managedAccounts {'accountsList': ','}
23:43:27,547 ibapi.wrapper INFO ANSWER nextValidId {'orderId': 1}
23:43:27,547 root INFO nextValidId: 1
23:43:27,548 ibapi.client INFO REQUEST reqContractDetails {'reqId': 1, 'contract': 140680240270976: 0,AMGN,STK,,0.0,,,SMART,,USD,,,False,,combo:}
23:43:27,548 ibapi.client INFO SENDING reqContractDetails b'\x00\x00\x00)9\x008\x001\x000\x00AMGN\x00STK\x00\x000.0\x00\x00\x00SMART\x00\x00USD\x00\x00\x000\x00\x00\x00'
23:43:27,549 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:uscrypto'}
23:43:27,549 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:uscrypto
23:43:27,550 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:usfuture.nj'}
23:43:27,550 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:usfuture.nj
23:43:27,550 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:hfarm'}
23:43:27,550 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:hfarm
23:43:27,550 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:usfarm.nj'}
23:43:27,551 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:usfarm.nj
23:43:27,551 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:jfarm'}
23:43:27,551 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:jfarm
23:43:27,551 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:cashfarm'}
23:43:27,551 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:cashfarm
23:43:27,552 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:eufarmnj'}
23:43:27,552 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:eufarmnj
23:43:27,552 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2104, 'errorString': 'Market data farm connection is OK:usfarm'}
23:43:27,552 ibapi.wrapper ERROR ERROR -1 2104 Market data farm connection is OK:usfarm
23:43:27,552 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:euhmds'}
23:43:27,553 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:euhmds
23:43:27,553 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:cashhmds'}
23:43:27,553 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:cashhmds
23:43:27,553 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:fundfarm'}
23:43:27,553 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:fundfarm
23:43:27,554 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2106, 'errorString': 'HMDS data farm connection is OK:ushmds'}
23:43:27,554 ibapi.wrapper ERROR ERROR -1 2106 HMDS data farm connection is OK:ushmds
23:43:27,554 ibapi.wrapper INFO ANSWER error {'reqId': -1, 'errorCode': 2158, 'errorString': 'Sec-def data farm connection is OK:secdefil'}
23:43:27,554 ibapi.wrapper ERROR ERROR -1 2158 Sec-def data farm connection is OK:secdefil
23:43:27,656 ibapi.wrapper INFO ANSWER contractDetails {'reqId': 1, 'contractDetails': 140680240269584: 266145,AMGN,STK,,0.0,,,SMART,NASDAQ,USD,AMGN,NMS,False,,combo:,NMS,0.01,ACTIVETIM,AD,ADJUST,ALERT,ALGO,ALLOC,AON,AVGCOST,BASKET,BENCHPX,CASHQTY,COND,CONDORDER,DARKONLY,DARKPOLL,DAY,DEACT,DEACTDIS,DEACTEOD,DIS,DUR,GAT,GTC,GTD,GTT,HID,IBKRATS,ICE,IMB,IOC,LIT,LMT,LOC,MIDPX,MIT,MKT,MOC,MTL,NGCOMB,NODARK,NONALGO,OCA,OPG,OPGREROUT,PEGBENCH,PEGMID,POSTATS,POSTONLY,PREOPGRTH,PRICECHK,REL,REL2MID,RELPCTOFS,RPI,RTH,SCALE,SCALEODD,SCALERST,SIZECHK,SMARTSTG,SNAPMID,SNAPMKT,SNAPREL,STP,STPLMT,SWEEP,TRAIL,TRAILLIT,TRAILLMT,TRAILMIT,WHATIF,SMART,AMEX,NYSE,CBOE,PHLX,ISE,CHX,ARCA,ISLAND,DRCTEDGE,BEX,BATS,EDGEA,CSFBALGO,JEFFALGO,BYX,IEX,EDGX,FOXRIVER,PEARL,NYSENAT,LTSE,MEMX,TPLUS1,PSX,1,0,AMGEN INC,,Consumer, Non-cyclical,Biotechnology,Medical-Biomedical/Gene,US/Eastern,20230326:CLOSED;20230327:0400-20230327:2000;20230328:0400-20230328:2000;20230329:0400-20230329:2000;20230330:0400-20230330:2000;20230331:0400-20230331:2000,20230326:CLOSED;20230327:0930-20230327:1600;20230328:0930-20230328:1600;20230329:0930-20230329:1600;20230330:0930-20230330:1600;20230331:0930-20230331:1600,,0,100,,,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,1,[140680240267952: ISIN=US0311621009;],,COMMON,,,,,,False,False,0,False,,,,,False,}
23:43:27,699 ibapi.client INFO REQUEST reqHeadTimeStamp {'reqId': 2, 'contract': 140680240268240: 266145,AMGN,STK,,0.0,,,SMART,NASDAQ,USD,AMGN,NMS,False,,combo:, 'whatToShow': 'TRADES', 'useRTH': 0, 'formatDate': 1}
23:43:27,699 ibapi.client INFO SENDING reqHeadTimeStamp b'\x00\x00\x00C87\x002\x00266145\x00AMGN\x00STK\x00\x000.0\x00\x00\x00SMART\x00NASDAQ\x00USD\x00AMGN\x00NMS\x000\x000\x00TRADES\x001\x00'
23:43:27,769 ibapi.client INFO disconnecting
23:43:27,769 ibapi.wrapper INFO ANSWER connectionClosed {}
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/ubuntu/DevOps/IBDownload/lib/python3.8/site-packages/ibapi/client.py", line 263, in run
self.decoder.interpret(fields)
File "/home/ubuntu/DevOps/IBDownload/lib/python3.8/site-packages/ibapi/decoder.py", line 1296, in interpret
handleInfo.processMeth(self, iter(fields))
File "/home/ubuntu/DevOps/IBDownload/lib/python3.8/site-packages/ibapi/decoder.py", line 844, in processHeadTimestamp
self.wrapper.headTimestamp(reqId,headTimestamp)
File "./src/download_bars.py", line 198, in headTimestamp
ts = self._parse_timestamp(headTimestamp)
File "./src/download_bars.py", line 191, in _parse_timestamp
tz = pytz.timezone(tokens[-1])
File "/home/ubuntu/DevOps/IBDownload/lib/python3.8/site-packages/pytz/init.py", line 188, in timezone
raise UnknownTimeZoneError(zone)
pytz.exceptions.UnknownTimeZoneError: '13:30:00'