MAINT: Some cleanup while working on batch ordering

This commit is contained in:
Richard Frank
2016-12-20 18:59:07 -05:00
parent 581e827208
commit d9a1479db7
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -939,7 +939,7 @@ def before_trading_start(context, data):
sim_params=self.sim_params,
env=self.env,
)
# Ensure that the environment's asset 0 is a Future
# Ensure that the environment's asset 3 is a Future
asset_to_test = algo.sid(3)
self.assertIsInstance(asset_to_test, Future)
@@ -1019,7 +1019,7 @@ def before_trading_start(context, data):
sim_params = SimulationParameters(
start_session=start_session,
end_session=period_end,
capital_base=float("1.0e5"),
capital_base=1.0e5,
data_frequency='minute',
trading_calendar=self.trading_calendar,
)
@@ -3701,7 +3701,7 @@ class TestEquityAutoClose(WithTmpDir, WithTradingCalendars, ZiplineTestCase):
cls.first_asset_expiration = cls.test_days[2]
def make_data(self, auto_close_delta, frequency,
capital_base=float("1.0e5")):
capital_base=1.0e5):
asset_info = make_jagged_equity_info(
num_assets=3,
+2 -2
View File
@@ -411,7 +411,7 @@ class TestTargetPercentAlgorithm(TradingAlgorithm):
def handle_data(self, data):
if not self.ordered:
assert 0 not in self.portfolio.positions
assert not self.portfolio.positions
else:
# Since you can't own fractional shares (at least in this
# example), we want to make sure that our target amount is
@@ -429,7 +429,7 @@ class TestTargetPercentAlgorithm(TradingAlgorithm):
"Orders not filled at current price."
self.sale_price = data.current(sid(0), "price")
self._order(self.sid(0), .002)
self._order(sid(0), .002)
self.ordered = True
def _order(self, asset, target):