major fix is with the non-blocking behavior of order source. also fixed time-compression in the trading client.

This commit is contained in:
fawce
2012-04-13 15:08:17 -04:00
parent dfc3523197
commit 38982fcdab
6 changed files with 77 additions and 42 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ class TestAlgorithm():
def handle_frame(self, frame):
self.frame_count += 1
#place an order for 100 shares of sid:133
#place an order for 100 shares of sid
if self.incr < self.count:
self.order(self.sid, self.amount)
self.incr += 1
+3 -3
View File
@@ -38,12 +38,12 @@ def load_market_data():
return bm_returns, tr_curves
def create_trading_environment():
def create_trading_environment(year=2006):
"""Construct a complete environment with reasonable defaults"""
benchmark_returns, treasury_curves = load_market_data()
start = datetime(2006, 1, 1, tzinfo=pytz.utc)
end = datetime(2006, 12, 31, tzinfo=pytz.utc)
start = datetime(year, 1, 1, tzinfo=pytz.utc)
end = datetime(year, 12, 31, tzinfo=pytz.utc)
trading_environment = TradingEnvironment(
benchmark_returns,
treasury_curves,