Partial fix for control flow bugs. ( See Jenkins )

This commit is contained in:
Stephen Diehl
2012-03-04 16:41:17 -05:00
parent 53b4876a19
commit fcc5298d6b
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -20,11 +20,14 @@ def create_trade_history(sid, prices, amounts, start_time, interval):
i = 0
trades = []
current = start_time.replace(tzinfo = pytz.utc)
while i < len(prices):
for price, amount in zip(prices, amounts):
if(risk.trading_calendar.is_trading_day(current)):
trades.append(create_trade(sid, prices[i], amounts[i], current))
trade = create_trade(sid, price, amount, current)
trades.append(trade)
current = current + interval
i += 1
else:
current = current + datetime.timedelta(days=1)
+1 -1
View File
@@ -158,7 +158,7 @@ class FinanceTestCase(TestCase):
trade_history = factory.create_trade_history( a, b, c, ts, dt )
set1 = SpecificEquityTrades("flat-133",)
set1 = SpecificEquityTrades("flat-133", trade_history)
#client sill send 10 orders for 100 shares of 133
client = TestTradingClient(133, 100, 10)