mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-11 14:39:49 +08:00
STY: pep8 fixes.
This commit is contained in:
@@ -325,9 +325,9 @@ class FinanceTestCase(TestCase):
|
||||
# move after market orders to just after market next
|
||||
# market open.
|
||||
if order_date.hour >= 21:
|
||||
if order_date.minute >= 00:
|
||||
order_date = order_date + timedelta(days=1)
|
||||
order_date = order_date.replace(hour=14, minute=30)
|
||||
if order_date.minute >= 00:
|
||||
order_date = order_date + timedelta(days=1)
|
||||
order_date = order_date.replace(hour=14, minute=30)
|
||||
|
||||
# there should now be one open order list stored under the sid
|
||||
oo = blotter.open_orders
|
||||
|
||||
@@ -654,8 +654,8 @@ class TestPositionPerformance(unittest.TestCase):
|
||||
trades[-1]['price'],
|
||||
"last sale should be same as last trade. \
|
||||
expected {exp} actual {act}".format(
|
||||
exp=trades[-1]['price'],
|
||||
act=pp.positions[1].last_sale_price)
|
||||
exp=trades[-1]['price'],
|
||||
act=pp.positions[1].last_sale_price)
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
||||
@@ -48,7 +48,7 @@ def get_treasury_source(start_date=None, end_date=None):
|
||||
|
||||
today = datetime.date.today()
|
||||
# Bank of Canada only has 10 years of data and has this in the URL.
|
||||
restriction = datetime.date(today.year-10, today.month, today.day)
|
||||
restriction = datetime.date(today.year - 10, today.month, today.day)
|
||||
|
||||
if not end_date:
|
||||
end_date = today
|
||||
|
||||
@@ -52,7 +52,7 @@ log = logbook.Logger('Trading')
|
||||
# you can use a TradingEnvironment in a with clause:
|
||||
# lse = TradingEnvironment(bm_index="^FTSE", exchange_tz="Europe/London")
|
||||
# with lse:
|
||||
# # the code here will have lse as the global trading.environment
|
||||
# the code here will have lse as the global trading.environment
|
||||
# algo.run(start, end)
|
||||
#
|
||||
# User code will not normally need to use TradingEnvironment
|
||||
|
||||
Reference in New Issue
Block a user