Replies: 2 comments
-
The "c" suffix means that is the contract for carry calculations. The August contract has been expired for a while. Can you try rolling it to an active contract and try running the script again? |
Beta Was this translation helpful? Give feedback.
0 replies
-
The 'c' in '20230800c' just means that the August 2023 contract is the carry contract. Which has expired a few months ago. Maybe you need to run interactive_update_roll_status and roll adjusted prices and see if that fixes it? Edit: 1 minute too slow! :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hoping someone can help me out with this, I've never run into this issue before, but the update_sampled_contracts.py script keeps choking and exiting on this one particular gas contract (see error below). When I run the diagnostics, I can manually check prices for the contract but I noted that it listed is as "20230800c" and not "20230800" when it shows which contracts are available so perhaps that's what's causing the error? It still works when just entering "20230800" into the interactive_diagnostics prompt. Thanks so much for any assistance here.
"C:\AC3 Trading System\venv\Scripts\python.exe" "C:\AC3 Trading System\pysystemtrade\sysproduction\update_sampled_contracts.py"
Configuring sim logging
C:\AC3 Trading System\venv\lib\site-packages\arctic_util.py:6: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.
from pandas.util.testing import assert_frame_equal
C:\AC3 Trading System\venv\lib\site-packages\arctic\store_pandas_ndarray_store.py:6: FutureWarning: The Panel class is removed from pandas. Accessing it from the top-level namespace will also be removed in the next version
from pandas import DataFrame, Series, Panel
2023-11-22 11:31:42 DEBUG config {'type': 'config', 'stage': 'config'} Adding config defaults
Instrument code?(Return for ALL)GAS-LAST
2023-11-22 11:31:51 INFO Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20230900'} Added contract GAS-LAST 20230900
2023-11-22 11:31:51 DEBUG Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20230900'} Contract GAS-LAST/20230900 now sampling
2023-11-22 11:31:51 INFO Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231100'} Added contract GAS-LAST 20231100
2023-11-22 11:31:51 DEBUG Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231100'} Contract GAS-LAST/20231100 now sampling
2023-11-22 11:31:51 INFO Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231000'} Added contract GAS-LAST 20231000
2023-11-22 11:31:51 DEBUG Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231000'} Contract GAS-LAST/20231000 now sampling
2023-11-22 11:31:51 DEBUG Update-Sampled_Contracts {'component': 'mongoIbBrokerClientIdData'} Locked IB client ID 187
2023-11-22 11:31:56 ERROR ib_insync.wrapper Error 200, reqId 3: No security definition has been found for the request, contract: Future(symbol='HH', lastTradeDateOrContractMonth='202309', multiplier='10000', exchange='NYMEX', currency='USD')
2023-11-22 11:31:56 WARNING Update-Sampled_Contracts {'component': 'ibFuturesContractData'} Reqid 3: 200 No security definition has been found for the request for Future(symbol='HH', lastTradeDateOrContractMonth='202309', multiplier='10000', exchange='NYMEX', currency='USD')
2023-11-22 11:31:56 WARNING Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20230900'} Contract is missing can't get expiry
2023-11-22 11:31:56 DEBUG Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20230900'} Can't find expiry for GAS-LAST/20230900, could be a connection problem but could be because contract has already expired
2023-11-22 11:31:56 INFO Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20230900'} Added contract GAS-LAST 20230900
2023-11-22 11:31:56 DEBUG Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20230900'} Contract GAS-LAST/20230900 has expired so now stopped sampling
2023-11-22 11:31:56 ERROR ib_insync.wrapper Error 200, reqId 4: No security definition has been found for the request, contract: Future(symbol='HH', lastTradeDateOrContractMonth='202310', multiplier='10000', exchange='NYMEX', currency='USD')
2023-11-22 11:31:56 WARNING Update-Sampled_Contracts {'component': 'ibFuturesContractData'} Reqid 4: 200 No security definition has been found for the request for Future(symbol='HH', lastTradeDateOrContractMonth='202310', multiplier='10000', exchange='NYMEX', currency='USD')
2023-11-22 11:31:56 WARNING Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231000'} Contract is missing can't get expiry
2023-11-22 11:31:56 DEBUG Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231000'} Can't find expiry for GAS-LAST/20231000, could be a connection problem but could be because contract has already expired
2023-11-22 11:31:56 INFO Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231000'} Added contract GAS-LAST 20231000
2023-11-22 11:31:56 DEBUG Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231000'} Contract GAS-LAST/20231000 has expired so now stopped sampling
2023-11-22 11:31:56 ERROR ib_insync.wrapper Error 200, reqId 5: No security definition has been found for the request, contract: Future(symbol='HH', lastTradeDateOrContractMonth='202311', multiplier='10000', exchange='NYMEX', currency='USD')
2023-11-22 11:31:56 WARNING Update-Sampled_Contracts {'component': 'ibFuturesContractData'} Reqid 5: 200 No security definition has been found for the request for Future(symbol='HH', lastTradeDateOrContractMonth='202311', multiplier='10000', exchange='NYMEX', currency='USD')
2023-11-22 11:31:56 WARNING Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231100'} Contract is missing can't get expiry
2023-11-22 11:31:56 DEBUG Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231100'} Can't find expiry for GAS-LAST/20231100, could be a connection problem but could be because contract has already expired
2023-11-22 11:31:56 INFO Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231100'} Added contract GAS-LAST 20231100
2023-11-22 11:31:56 DEBUG Update-Sampled_Contracts {'instrument_code': 'GAS-LAST', 'contract_date': '20231100'} Contract GAS-LAST/20231100 has expired so now stopped sampling
2023-11-22 11:31:56 DEBUG connectionIB {'type': 'Update-Sampled_Contracts', 'broker': 'IB', 'clientid': 187} Terminating {'ipaddress': 'localhost', 'port': 4001, 'client': 187}
2023-11-22 11:31:56 DEBUG Update-Sampled_Contracts {'component': 'mongoIbBrokerClientIdData'} Released IB client ID 187
Traceback (most recent call last):
File "C:\AC3 Trading System\pysystemtrade\sysproduction\update_sampled_contracts.py", line 453, in
update_sampled_contracts()
File "C:\AC3 Trading System\pysystemtrade\sysproduction\update_sampled_contracts.py", line 45, in update_sampled_contracts
update_contracts_object.update_sampled_contracts(
File "C:\AC3 Trading System\pysystemtrade\sysproduction\update_sampled_contracts.py", line 73, in update_sampled_contracts
update_active_contracts_with_data(data, instrument_code=instrument_code)
File "C:\AC3 Trading System\pysystemtrade\sysproduction\update_sampled_contracts.py", line 86, in update_active_contracts_with_data
update_active_contracts_for_instrument(instrument_code, data)
File "C:\AC3 Trading System\pysystemtrade\sysproduction\update_sampled_contracts.py", line 104, in update_active_contracts_for_instrument
check_key_contracts_have_not_expired(instrument_code=instrument_code, data=data)
File "C:\AC3 Trading System\pysystemtrade\sysproduction\update_sampled_contracts.py", line 418, in check_key_contracts_have_not_expired
list_of_expired_ids = [
File "C:\AC3 Trading System\pysystemtrade\sysproduction\update_sampled_contracts.py", line 419, in
has_contract_expired(
File "C:\AC3 Trading System\pysystemtrade\sysproduction\update_sampled_contracts.py", line 447, in has_contract_expired
actual_contract = data_contracts.get_contract_from_db(contract)
File "C:\AC3 Trading System\pysystemtrade\sysproduction\data\contracts.py", line 190, in get_contract_from_db
db_contract = self.get_contract_from_db_given_code_and_id(
File "C:\AC3 Trading System\pysystemtrade\sysproduction\data\contracts.py", line 200, in get_contract_from_db_given_code_and_id
contract_object = self.db_contract_data.get_contract_object(
File "C:\AC3 Trading System\pysystemtrade\sysdata\futures\contracts.py", line 41, in get_contract_object
raise ContractNotFound(
syscore.exceptions.ContractNotFound: Contract GAS-LAST/20230800 not found
Process finished with exit code 1
Beta Was this translation helpful? Give feedback.
All reactions