Closed spickering-git closed 7 years ago
@alexveden When creating several of the indexes on the instruments we pass in the opt_codes in the INDEX_CONTEXT. Lets look at ES, we pass ['EW','EW1','EW2','EW3','EW4','']
INDEX_CONTEXT = { 'instrument': "US.ES", 'context':{'costs_futures': 3.0, 'costs_options': 3.0} } INDEX_CONTEXT['opt_codes'] = ['EW','EW1','EW2','EW3','EW4',''] index = EXODeltaTargetGeneric(dm, **INDEX_CONTEXT)
The problem arises when we make a call to calculate the index after it is already created
dm = DataManager(date_start=datetime(2011, 1, 1)) instrument = 'US.ES' index = IndexBase.load(dm, instrument + '_EXOLongEnhance_DT')
index.opt_codes returns [] We believe this is causing the problem that we are seeing where there are Wednesday ES options. See this test notebook I set up for you to help debug. https://10.0.1.2:8889/notebooks/indexes/index_deployment_samples/deploy_index_not_saving_opt_code.ipynb
If you want to save custom data you should use the 'context' sub-dictionary:
INDEX_CONTEXT['context']['opt_codes'] = ['EW','EW1','EW2','EW3','EW4','']
fixed
@alexveden When creating several of the indexes on the instruments we pass in the opt_codes in the INDEX_CONTEXT. Lets look at ES, we pass ['EW','EW1','EW2','EW3','EW4','']
The problem arises when we make a call to calculate the index after it is already created
index.opt_codes returns [] We believe this is causing the problem that we are seeing where there are Wednesday ES options. See this test notebook I set up for you to help debug. https://10.0.1.2:8889/notebooks/indexes/index_deployment_samples/deploy_index_not_saving_opt_code.ipynb