trendmanagement / Tmqr-framework-2

3 stars 0 forks source link

Task: Alex - Urgent Bug - High Priority - Due ASAP, Re: Index generation #84

Closed spickering-git closed 6 years ago

spickering-git commented 6 years ago

@alexveden There seems to be an issue with running the indexes today. I checked for the futures data in V2 and it is there. Testing with CL results in the following error. Speculating it has to do with the holiday on Friday. please have a look at this error


WARNING: ExtraSeriesSanityCheck: 'QuoteIndex-US.CL_EXOLongEnhance_DT_PutSpread_index_hedge' - extra quotes could be delayed. Primary last date: 2017-11-13 11:10:00-08:00 Extra last date: 2017-11-09 11:10:00-08:00
/home/tmqr_framework2/tmqr_framework2/tmqralphas/strategy_v1_hedge_with_index.py:41: UserWarning: 'index_passive_name' is not set in context, skipping.
  warnings.warn("'index_passive_name' is not set in context, skipping.")
/home/tmqr_framework2/tmqr_framework2/tmqralphas/strategy_v1_hedge_with_index.py:44: UserWarning: You must set 'costs_per_option' in 'context' kwarg, using default 3.0!
  warnings.warn("You must set 'costs_per_option' in 'context' kwarg, using default 3.0!")
/home/tmqr_framework2/tmqr_framework2/tmqralphas/strategy_v1_hedge_with_index.py:46: UserWarning: You must set 'costs_per_contract' in 'context' kwarg, using default 3.0!
  warnings.warn("You must set 'costs_per_contract' in 'context' kwarg, using default 3.0!")
DEBUG: Quotes range: 2009-12-18 - 2017-11-13
DEBUG: Processing OOS: 2017-10-28 - 2017-12-30
ERROR: Couldn't find hedged index position! No positions records found at 2017-11-10 11:05:00-08:00
ERROR: Couldn't find hedged index position! No positions records found at 2017-11-13 11:05:00-08:00
INFO: Starting strategy <tmqralphas.strategy_v1_hedge_with_index.AlphaV1HedgeWithIndex object at 0x7f3aac5d4198>. Date now: 2017-11-13 12:59:19.545571
WARNING: ExtraSeriesSanityCheck: 'QuoteIndex-US.CL_EXOLongEnhance_DT_PutSpread_index_hedge' - extra quotes could be delayed. Primary last date: 2017-11-13 11:10:00-08:00 Extra last date: 2017-11-09 11:10:00-08:00
DEBUG: Quotes range: 2009-12-18 - 2017-11-13
DEBUG: Processing OOS: 2017-10-28 - 2017-12-30
ERROR: Couldn't find hedged index position! No positions records found at 2017-11-13 11:05:00-08:00
INFO: Finished in 4.95 seconds. Avg. optimize time: 0.00sec Avg. process time: 0.00sec Avg. Stats time: 2.526
INFO: Starting strategy <tmqralphas.strategy_v1_hedge_with_index.AlphaV1HedgeWithIndex object at 0x7f3a6d576b70>. Date now: 2017-11-13 12:59:24.553536

The following is a test notebook for running the indexes and alphas https://10.0.1.2:8889/notebooks/dashboard/V2_script_performance_analysis.ipynb

spickering-git commented 6 years ago

This is the error

Quote is not found at 2017-11-09 11:10:00-08:00 ERROR index US.CL_EXOLongEnhance_DT

alexveden commented 6 years ago

Fixed, these 2 lines were the reason of failure.

https://github.com/trendmanagement/Tmqr-framework-2/blob/master/tmqrindex/index_exo_base.py#L114

https://github.com/trendmanagement/Tmqr-framework-2/blob/master/tmqrindex/index_exo_base.py#L129

Just wrapped them with try-except block to catch the missing prices exceptions, in case of holidays.

spickering-git commented 6 years ago

looks like the alphas haven't calculated

image

https://10.0.1.2:8888/notebooks/Money%20Management%20Alphas/Campaign%20CL%20alpha%2C%20index%20error%20trace.ipynb