File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -518,12 +518,11 @@ def _clear_out_of_market_hours(df):
518518 segment_start = dtbegin
519519 segment_end = segment_start + timedelta (weeks = 2 ) if \
520520 dtend - dtbegin >= timedelta (weeks = 2 ) else dtend
521- while segment_end <= dtend :
522- if not cdl .empty and dtend <= cdl .index [- 1 ]:
523- # when resampling the data dtend is not promised to be
524- # a part of cdl. we just want to make sure we have data
525- # that should contain it.
526- break
521+ while cdl .empty or cdl .index [- 1 ] < dtend :
522+ # we want to collect data until the last row is later than
523+ # the requested dtend. we don't force it to contain dtend
524+ # because it might be missing, or we may be resampling (so
525+ # again, it will be missing)
527526 response = self .oapi .polygon .historic_agg_v2 (
528527 dataname ,
529528 compression ,
You can’t perform that action at this time.
0 commit comments