From 6a4ea43d27c1ff91f6533e3260ae0afcc2db92b6 Mon Sep 17 00:00:00 2001 From: Victor Grau Serrat Date: Tue, 31 Oct 2017 09:51:37 -0600 Subject: [PATCH 1/6] DOC: updated README --- README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 3425bac6..8b79b698 100644 --- a/README.rst +++ b/README.rst @@ -1 +1,3 @@ -All the documentation for `Catalyst `_ can be found in the `catalyst-docs wiki `_. \ No newline at end of file +All the documentation for `Catalyst `_ +can be found in the +`documentation website `_. \ No newline at end of file From 5d251f6f9a24847b17e0c51e673e5358172b6de9 Mon Sep 17 00:00:00 2001 From: fredfortier Date: Thu, 2 Nov 2017 21:06:11 -0400 Subject: [PATCH 2/6] BLD: modified algo for testing --- catalyst/examples/simple_loop.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/catalyst/examples/simple_loop.py b/catalyst/examples/simple_loop.py index 9ebf93b1..75702c33 100644 --- a/catalyst/examples/simple_loop.py +++ b/catalyst/examples/simple_loop.py @@ -29,25 +29,25 @@ def handle_data(context, data): print(e) -# run_algorithm( -# capital_base=250, -# start=pd.to_datetime('2017-1-1', utc=True), -# end=pd.to_datetime('2017-10-22', utc=True), -# data_frequency='daily', -# initialize=initialize, -# handle_data=handle_data, -# analyze=None, -# exchange_name='bitfinex', -# algo_namespace='simple_loop', -# base_currency='btc' -# ) run_algorithm( + capital_base=250, + start=pd.to_datetime('2017-1-1', utc=True), + end=pd.to_datetime('2017-10-22', utc=True), + data_frequency='minute', initialize=initialize, handle_data=handle_data, analyze=None, - exchange_name='poloniex', - live=True, + exchange_name='bitfinex', algo_namespace='simple_loop', - base_currency='eth', - live_graph=False + base_currency='btc' ) +# run_algorithm( +# initialize=initialize, +# handle_data=handle_data, +# analyze=None, +# exchange_name='poloniex', +# live=True, +# algo_namespace='simple_loop', +# base_currency='eth', +# live_graph=False +# ) From 360e1adc221396e66fcea84014121522807d124e Mon Sep 17 00:00:00 2001 From: fredfortier Date: Sat, 4 Nov 2017 14:56:24 -0400 Subject: [PATCH 3/6] BLD: resolving conflict with algo --- catalyst/examples/simple_loop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/examples/simple_loop.py b/catalyst/examples/simple_loop.py index 75702c33..8737d177 100644 --- a/catalyst/examples/simple_loop.py +++ b/catalyst/examples/simple_loop.py @@ -50,4 +50,4 @@ run_algorithm( # algo_namespace='simple_loop', # base_currency='eth', # live_graph=False -# ) +# ) \ No newline at end of file From 5abdc063eb3a406d4ba2feeea73c7b1081863c98 Mon Sep 17 00:00:00 2001 From: fredfortier Date: Sat, 4 Nov 2017 14:57:54 -0400 Subject: [PATCH 4/6] BLD: resolving conflict with algo --- catalyst/examples/simple_loop.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalyst/examples/simple_loop.py b/catalyst/examples/simple_loop.py index 8737d177..eefd6ecb 100644 --- a/catalyst/examples/simple_loop.py +++ b/catalyst/examples/simple_loop.py @@ -31,9 +31,9 @@ def handle_data(context, data): run_algorithm( capital_base=250, - start=pd.to_datetime('2017-1-1', utc=True), - end=pd.to_datetime('2017-10-22', utc=True), - data_frequency='minute', + start=pd.to_datetime('2016-6-1', utc=True), + end=pd.to_datetime('2016-12-31', utc=True), + data_frequency='daily', initialize=initialize, handle_data=handle_data, analyze=None, From ba4ffc727234ddc2e444e99a858bd45c8d135c38 Mon Sep 17 00:00:00 2001 From: fredfortier Date: Mon, 6 Nov 2017 15:04:44 -0500 Subject: [PATCH 5/6] BUG: working on issue #57 --- catalyst/support/issue_57.py | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 catalyst/support/issue_57.py diff --git a/catalyst/support/issue_57.py b/catalyst/support/issue_57.py new file mode 100644 index 00000000..a7bf0226 --- /dev/null +++ b/catalyst/support/issue_57.py @@ -0,0 +1,42 @@ +import talib +import pandas as pd + +from catalyst import run_algorithm +from catalyst.api import symbol + + +def initialize(context): + print('initializing') + context.asset = symbol('btc_usdt') + + +def handle_data(context, data): + print('handling bar: {}'.format(data.current_dt)) + + price = data.current(context.asset, 'close') + print('got price {price}'.format(price=price)) + + try: + prices = data.history( + context.asset, + fields='close', + bar_count=60, + frequency='1D' + ) + print('got {} price entries\n'.format(len(prices), prices)) + except Exception as e: + print(e) + + +run_algorithm( + capital_base=1, + start=pd.to_datetime('2016-2-11', utc=True), + end=pd.to_datetime('2017-8-31', utc=True), + data_frequency='daily', + initialize=initialize, + handle_data=handle_data, + analyze=None, + exchange_name='bittrex', + algo_namespace='issue_57', + base_currency='btc' +) From 9093be748e21cdbbfffeb3731db9704281030804 Mon Sep 17 00:00:00 2001 From: fredfortier Date: Tue, 14 Nov 2017 13:58:24 -0500 Subject: [PATCH 6/6] BUG: fixed a warning filter issue --- catalyst/finance/risk/cumulative.py | 6 ++++-- docs/source/releases.rst | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/catalyst/finance/risk/cumulative.py b/catalyst/finance/risk/cumulative.py index 324547f5..82dd5c0b 100644 --- a/catalyst/finance/risk/cumulative.py +++ b/catalyst/finance/risk/cumulative.py @@ -45,8 +45,6 @@ log = logbook.Logger('Risk Cumulative', level=LOG_LEVEL) choose_treasury = functools.partial(choose_treasury, lambda *args: '10year', compound=False) -warnings.filterwarnings('error') - class RiskMetricsCumulative(object): """ @@ -146,6 +144,8 @@ class RiskMetricsCumulative(object): self.num_trading_days = 0 def update(self, dt, algorithm_returns, benchmark_returns, leverage): + warnings.filterwarnings('error') + # Keep track of latest dt for use in to_dict and other methods # that report current state. self.latest_dt = dt @@ -292,6 +292,8 @@ algorithm_returns ({algo_count}) in range {start} : {end} on {dt}" self.max_leverage = self.calculate_max_leverage() self.max_leverages[dt_loc] = self.max_leverage + warnings.resetwarnings() + def to_dict(self): """ Creates a dictionary representing the state of the risk report. diff --git a/docs/source/releases.rst b/docs/source/releases.rst index 6945a1b7..b178ec58 100644 --- a/docs/source/releases.rst +++ b/docs/source/releases.rst @@ -2,6 +2,15 @@ Release Notes ============= +Version 0.3.8 +^^^^^^^^^^^^^ +**Release Date**: 2017-11-14 + +Bug Fixes +~~~~~~~~~ + +- Fixed a warning filter issue introduced with the latest release + Version 0.3.7 ^^^^^^^^^^^^^ **Release Date**: 2017-11-14