ENH: Changes the default offset for time_rules.market_open to 1, and

makes it an offset from 13:30 UTC.

This is to be more consistent with the market_close, which is an offset
from 20:00 UTC.

This also makes market_open and market_close cache the dt to offset from
for each day.
This commit is contained in:
llllllllll
2014-11-05 14:59:48 -05:00
committed by Joe Jevnik
parent e1a55131ec
commit 9ddb033e67
2 changed files with 36 additions and 8 deletions
+7 -2
View File
@@ -260,9 +260,14 @@ class TestStatelessRules(RuleTestCase):
def test_AfterOpen(self):
should_trigger = AfterOpen(minutes=5, hours=1).should_trigger
for d in self.trading_days:
for m in islice(d, 65):
for m in islice(d, 64):
# Check the first 64 minutes of data.
# We use 64 because the offset is from market open
# at 13:30 UTC, meaning the first minute of data has an
# offset of 1.
self.assertFalse(should_trigger(m))
for m in islice(d, 65, None):
for m in islice(d, 64, None):
# Check the rest of the day.
self.assertTrue(should_trigger(m))
def test_BeforeClose(self):