From f58bc4f50b2066e1ea20f9d8be61e272703983f7 Mon Sep 17 00:00:00 2001 From: camelpac Date: Sun, 2 Jan 2022 23:10:48 +0200 Subject: [PATCH 1/6] fix call to is_market_open when using the new exchange_calendars --- alpaca_backtrader_api/alpacastore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpaca_backtrader_api/alpacastore.py b/alpaca_backtrader_api/alpacastore.py index 667abed2..b9f0ffca 100644 --- a/alpaca_backtrader_api/alpacastore.py +++ b/alpaca_backtrader_api/alpacastore.py @@ -445,7 +445,7 @@ def _make_sure_dates_are_initialized_properly(self, dtbegin, dtend, not dtend.tzname() else dtend if granularity == Granularity.Minute: calendar = exchange_calendars.get_calendar(name='NYSE') - while not calendar.is_open_on_minute(dtend): + while not calendar.is_open_on_minute(dtend.ceil(freq='T')): dtend = dtend.replace(hour=15, minute=59, second=0, From c465e7ffaa3d6faa6e4a43f5a61d6ad44d2e389e Mon Sep 17 00:00:00 2001 From: camelpac Date: Sun, 2 Jan 2022 23:14:56 +0200 Subject: [PATCH 2/6] update requirements for python > 3.6 --- requirements/requirements.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index b4a0c780..f845e767 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,3 +1,7 @@ backtrader==1.9.76.123 -alpaca-trade-api==1.2.3 -exchange_calendars==3.2 +alpaca-trade-api==1.4.3 +exchange-calendars==3.4 +matplotlib==2.2.5 +msgpack==1.0.2 +numpy==1.21.2 +pandas==1.3.2 From 4af15ee7d8013345a213740cd36389a6321f0d5d Mon Sep 17 00:00:00 2001 From: camelpac Date: Sun, 2 Jan 2022 23:18:22 +0200 Subject: [PATCH 3/6] update minimum python version to 3.7 --- setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a994ef5d..2403884b 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,6 @@ with open(os.path.join("requirements", "requirements_test.txt")) as reqs: REQUIREMENTS_TEST = reqs.readlines() - setup( name='alpaca-backtrader-api', version=version, @@ -30,6 +29,15 @@ author='Alpaca', author_email='oss@alpaca.markets', url='https://github.com/alpacahq/alpaca-backtrader-api', + classifiers=[ + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + + # Operating Systems on which it runs + 'Operating System :: OS Independent', + ], keywords='financial,timeseries,api,trade,backtrader', packages=['alpaca_backtrader_api'], install_requires=REQUIREMENTS, From e788b69c0239221b0dbb25607c9c6618b75848e8 Mon Sep 17 00:00:00 2001 From: camelpac Date: Sun, 2 Jan 2022 23:21:30 +0200 Subject: [PATCH 4/6] update tests to run on python3.8 --- .circleci/config.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d8709fc8..a3d543a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,10 +2,10 @@ version: 2 jobs: build-python36: docker: - - image: python:3.6.7 + - image: python:3.8.11 working_directory: ~/repo steps: - - run: echo "hello python 3.6.7" + - run: echo "hello python 3.8.11" - checkout # Download and cache dependencies @@ -23,7 +23,6 @@ jobs: - run: name: run tests command: | - pip install pandas==1.1.5 numpy==1.19.4 scipy==1.5.4 pip install flake8 && flake8 python setup.py develop python setup.py test @@ -34,11 +33,11 @@ jobs: key: v1-dependencies-{{ checksum "setup.py" }} - store_artifacts: - path: test-reports3.6.7 - destination: test-reports3.6.7 + path: test-reports3.8.11 + destination: test-reports3.8.11 workflows: version: 2 build: jobs: - - build-python36 + - build-python38 From 5f5f7433d92701bfe9ecc66cbc6a1767d9d8bcea Mon Sep 17 00:00:00 2001 From: camelpac Date: Sun, 2 Jan 2022 23:22:23 +0200 Subject: [PATCH 5/6] typo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a3d543a9..edad3033 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2 jobs: - build-python36: + build-python38: docker: - image: python:3.8.11 working_directory: ~/repo From 8fdb0b060cc78dab69879013a2383d153b2f2a7a Mon Sep 17 00:00:00 2001 From: camelpac Date: Sun, 2 Jan 2022 23:24:54 +0200 Subject: [PATCH 6/6] update version --- alpaca_backtrader_api/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpaca_backtrader_api/__init__.py b/alpaca_backtrader_api/__init__.py index 86266802..dd52e078 100644 --- a/alpaca_backtrader_api/__init__.py +++ b/alpaca_backtrader_api/__init__.py @@ -5,4 +5,4 @@ __all__ = [ 'AlpacaStore', 'AlpacaBroker', 'AlpacaData', ] -__version__ = '0.14.1' +__version__ = '0.15.0'