trendmanagement / tmqrexo_alexveden

1 stars 1 forks source link

Cocoa exos and rollover #125

Open spickering-git opened 7 years ago

spickering-git commented 7 years ago

@alexveden can you please check the rollover_months for cocoa image In our Slack conversation you said this is the rollover schedule for the futures, is this correct? Where is the rollover schedule for the options setup?

The cocoa exos are not correct. eg. the cocoa call spread image

however the cocoa ContFut is image

We would expect the call spread to trend upwards similar to the contfut.

spickering-git commented 7 years ago

@alexveden Is there a way to just set up the contfut exo for cocoa, and suppress all the rest? Then just create some test exos before running the entire lot of them. There is obviously an issue we need to debug with cocoa, and this will certainly go on with other instruments we add. So this process would be helpful in the future for new instruments.

alexveden commented 7 years ago

In our Slack conversation you said this is the rollover schedule for the futures, is this correct? Where is the rollover schedule for the options setup?

y, correct. There is only futures series rollover schedule available, I'm picking most recent options series available for the particular future contract.

Is there a way to just set up the contfut exo for cocoa, and suppress all the rest?

There is no elegant way to filter instruments for EXO calculation, except ASSET_LIST = ['CL', .... 'ES''] setting inside each SmartEXO code.

spickering-git commented 7 years ago

@alexveden

  1. I have cleared out and re-imported the SPAN data for CC. There was a bunch of garbage data related to the options that resulted from old futures contracts prior to 2010. Can we clear out all of the CC exos and start again? I know you said its a pain, but should we add all the current instruments to the active exos. Then we could just add the CC contFut EXO and test build all the other exos on CC. I am still concerned there will be bugs because the roll schedule needs to be tested.

  2. The correct CC roll schedule is something we haven't dealt with before. We had a meeting with an agricultural expert on CC and he explained that we should follow a schedule of always working with 2nd deferred futures contracts and the options on those contracts. We may want to be able to specify different roll schedules for different EXOs. This may be 1 scenario, but there could be other roll schedules for CC. Please Review and comment image

alexveden commented 7 years ago

Can we clear out all of the CC exos and start again?

Ok, will do it this weekend.

We may want to be able to specify different roll schedules for different EXOs.

Probably it won't be so hard, just few minor changes in the strategies code.

Could you explain the picture above, is it about analyzing orange rollover and trading yellow color regime? Or this is just for comparison?

alexveden commented 7 years ago

@spickering-git can you comment please?

While working on CC rollover issues I'm getting this error ValueError: Failed to find options quotes while processing chain at 2014-11-05 00:00:00, also for years 2015 and 2016.

Did you change options IDs in SQL when was doing data cleanup couple days ago? I have 2 versions:

  1. You have problems with CC in the DB
  2. I need to rebuild asset index in Mongo to reflect recent CC backfills
spickering-git commented 7 years ago

I had to clear CC futures contracts prior to 2011. The older future contracts were causing problems with the option contracts. The idcontract in the options were wrong. All options and their data was cleared and reloaded. All the CC data should be deleted and reloaded into mongodb.

alexveden commented 7 years ago

Could you tell are any problems still existing with CC?

nikolas-joyce commented 7 years ago

I think Steve said that it would work once the mongo db for version 1 is available. I will ask him to comment here.

Sent from my iPhone

On Apr 7, 2017, at 3:14 AM, alexveden notifications@github.com<mailto:notifications@github.com> wrote:

Could you tell are any problems still existing with CC?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/trendmanagement/tmqrexo_alexveden/issues/125#issuecomment-292498683, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ARobLJ8Pfx5saIkuSHIdrQP1zSsV4uNAks5rtgxbgaJpZM4MH19l.

spickering-git commented 7 years ago

I will not be loading CC until the CME reload from 2014 forward is finished.

Once I can confirm CC has been loaded properly, @alexveden will have to use the version of the model that points to tmldb_v2 to test cocoa exos etc.

spickering-git commented 7 years ago

@alexveden can you please have a look at loading the ICE data, specifically cocoa. The span load software is crashing. here is the data https://app.box.com/s/shzckeooe4erxgc8qpuids5rfgl041mr

alexveden commented 7 years ago

@spickering-git I've found that the script crashes only when 'contractexpirations' collection is absent in MongoDB. When I copied 'contractexpirations' from tmldb_v2 to my local machine everything goes fine, I've tried years 2017 and 2016.

Anyway I've added checks for this problem to the code.

p.s. You can restore 'contractexpirations' to you local machine, download 'dump' folder from /home/tmqrquant (at 10.0.1.2 machine via SFTP) Then run on your local machine:

cd ...path../dump mongorestore -d tmldb -c contractexpirations --gzip ./tmldb_v2/contractexpirations.bson.gz

Assuming that your local DB doesn't use authentication and the DB name is tmldb

spickering-git commented 7 years ago

Assertion error when running CC 2013 and CC 2012

Traceback (most recent call last): File "C:/Span_Procedures_Cloud/span_data_collector-master/span_reader/run_span_import.py", line 30, in csi.load_span_file(futures_filepath, options_filepath) File "C:\Span_Procedures_Cloud\span_data_collector-master\span_reader\ice_span.py", line 406, in load_span_file self.save_options_quotes(options_df, options_info, futures_df) File "C:\Span_Procedures_Cloud\span_data_collector-master\span_reader\ice_span.py", line 372, in save_options_quotes assert iv >= 0 AssertionError

alexveden commented 7 years ago

Assertion error when running CC 2013 and CC 2012

Fixed, the reason was in underlying price when it equals to NaN