mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-12 12:12:04 +08:00
major fix is with the non-blocking behavior of order source. also fixed time-compression in the trading client.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user