trendmanagement / Tmqr-framework-2

3 stars 0 forks source link

Alex - Holiday Data in V2 Question -Answer by Thursday Nov 16 2017 #87

Open spickering-git opened 6 years ago

spickering-git commented 6 years ago

@alexveden regarding the filtering of data to not include holidays for future data in V2,

Can we simply just not include future data on the actual day of the holiday or do we have to stop the data at the execution time of the previous day and start data again at the execution time on the holiday.

For example US.CL "decision" : "11:10", "execution" : "11:15"

Holiday last friday would either:

  1. no data for US.CL on friday Nov 10 from 00:00 to 23:59 or
  2. data up to thurs. 11:15, no data after that until Nov 10 at 11:16 data starts again.

Please advise on correct solution to deal with holidays in V2. We have U.S. Thanksgiving coming up next week so I need to get this done right away.

alexveden commented 6 years ago

The simplest way is to get rid of holidays in v2 Mongo 'quotes_intraday' collection. You can just delete these days, or better just do not add new holidays dates in the future for keeping equity lines the same. Also, note that data in 'quotes_intraday' is in UTC timezone, because of this you must keep in mind that it might be added to the collection when you have a different date in Pacific time zone.

Here is an example: https://10.0.1.2:8889/notebooks/data/Import%20futures%20data.ipynb image

Also, keep in mind that this method works only if the trading session start and end( exec time ) do not overlap with different UTC days. As I can see, you have starting time 05:00 Pacific time (12 pm UTC) for all instruments in the V2 and there is no issue in a current situation. However double check your quotes update scripts (online and offline) that they use UTC timezone to check for new date arrival.

You can use v1 code snippet to check holidays: https://github.com/trendmanagement/tmqrexo_alexveden/blob/new_mongo/scripts/exo_builder.py#L124