ENH: Update can_trade to check exchange time

BarData now takes the trading calendar as a parameter.

can_trade now checks if the asset’s exchange is open at the current or
next market minute (defined by the given trading calendar).
This commit is contained in:
Jean Bredeche
2016-08-31 21:22:06 -04:00
parent af75a1f67c
commit 46c0c064fe
8 changed files with 289 additions and 143 deletions
+3 -1
View File
@@ -188,7 +188,9 @@ class TestAPIShim(WithDataPortal, WithSimParams, ZiplineTestCase):
)[-1]
bar_data = BarData(
self.data_portal,
lambda: test_end_minute, "minute"
lambda: test_end_minute,
"minute",
self.trading_calendar
)
ohlcvp_fields = [
"open",