mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-12 07:09:49 +08:00
Partial fix for control flow bugs. ( See Jenkins )
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user