Skip to content

Commit

Permalink
merge master to develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lenak25 committed May 17, 2018
2 parents de0c267 + c4ecadd commit 8f1eccd
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
7 changes: 4 additions & 3 deletions catalyst/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,14 +400,14 @@ def catalyst_magic(line, cell=None):
@click.option(
'-s',
'--start',
type=Date(tz='utc', as_timestamp=True),
type=Date(tz='utc', as_timestamp=False),
help='An optional future start date at '
'which the algorithm will start at live',
)
@click.option(
'-e',
'--end',
type=Date(tz='utc', as_timestamp=True),
type=Date(tz='utc', as_timestamp=False),
help='An optional end date at which to stop the execution.',
)
@click.option(
Expand Down Expand Up @@ -444,6 +444,7 @@ def live(ctx,
exchange_name,
algo_namespace,
quote_currency,
start,
end,
live_graph,
auth_aliases,
Expand Down Expand Up @@ -487,7 +488,7 @@ def live(ctx,
data=None,
bundle=None,
bundle_timestamp=None,
start=None,
start=start,
end=end,
output=output,
print_algo=print_algo,
Expand Down
6 changes: 5 additions & 1 deletion catalyst/examples/portfolio_optimization.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
'''Use this code to execute a portfolio optimization model. This code
'''
Author: Rodrigo Gomez-Grassi
Date: Sep. 20, 2017
Use this code to execute a portfolio optimization model. This code
will select the portfolio with the maximum Sharpe Ratio. The parameters
are set to use 180 days of historical data and rebalance every 30 days.
Expand Down
2 changes: 1 addition & 1 deletion catalyst/exchange/live_graph_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def handle_late_start(self):
if self.start:
time_diff = (self.start - pd.Timestamp.utcnow())
log.info(
'Tha algorithm is waiting for the specified '
'The algorithm is waiting for the specified '
'start date: {}'.format(self.start))
sleep(time_diff.seconds)

Expand Down
2 changes: 1 addition & 1 deletion catalyst/exchange/simple_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def handle_late_start(self):
if self.start:
time_diff = (self.start - pd.Timestamp.utcnow())
log.info(
'Tha algorithm is waiting for the specified '
'The algorithm is waiting for the specified '
'start date: {}'.format(self.start))
sleep(time_diff.seconds)

Expand Down
2 changes: 1 addition & 1 deletion catalyst/utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __init__(self, tz=None, as_timestamp=False):

def parser(self, value):
ts = super(Date, self).parser(value)
return ts.normalize() if self.as_timestamp else ts.date()
return ts.normalize() if self.as_timestamp else ts


class Time(_DatetimeParam):
Expand Down
5 changes: 5 additions & 0 deletions catalyst/utils/run_algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ def choose_loader(column):
if start is None:
start = pd.Timestamp.utcnow()
is_start = False
elif start:
assert pd.Timestamp.utcnow() <= start, \
"specified start date is in the past."
elif start and end:
assert start < end, "start date is later than end date."

# TODO: fix the end data.
# is_end checks if an end date was specified by user
Expand Down
11 changes: 11 additions & 0 deletions docs/source/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
Release Notes
=============

Version 0.5.11
^^^^^^^^^^^^^^
**Release Date**: 2018-05-09

Bug Fixes
~~~~~~~~~
- Added missing start_date argument on live mode when running on cli
:issue:`330`
- Updated the start and end arguments used on cli in live mode to include
time information in addition to the date.

Version 0.5.10
^^^^^^^^^^^^^^
**Release Date**: 2018-05-09
Expand Down

0 comments on commit 8f1eccd

Please sign in to comment.