-
-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
40 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
__author__ = 'saeedamen' # Saeed Amen / [email protected] | ||
|
||
# | ||
# Copyright 2016 Cuemacro | ||
# Copyright 2020 Cuemacro | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the | ||
# License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 | ||
|
@@ -40,7 +40,7 @@ def plot_chart(self, tickers=None, tickers_rhs=None, start_date=None, finish_dat | |
reindex=False, yoy=False, plotly_plot_mode='offline_png', | ||
quandl_api_key=dataconstants.quandl_api_key, | ||
fred_api_key=dataconstants.fred_api_key, | ||
alpha_vantage_api_key=dataconstants.alpha_vantage_api_key): | ||
alpha_vantage_api_key=dataconstants.alpha_vantage_api_key, df=None): | ||
|
||
if start_date is None: | ||
start_date = datetime.datetime.utcnow().date() - timedelta(days=60) | ||
|
@@ -72,17 +72,19 @@ def plot_chart(self, tickers=None, tickers_rhs=None, start_date=None, finish_dat | |
else: | ||
tickers_rhs = {} | ||
|
||
md_request = MarketDataRequest(start_date=start_date, finish_date=finish_date, | ||
freq=freq, | ||
data_source=self._data_source, | ||
tickers=list(tickers.keys()), vendor_tickers=list(tickers.values()), | ||
fields=list(fields.keys()), | ||
vendor_fields=list(fields.values()), | ||
quandl_api_key=quandl_api_key, | ||
fred_api_key=fred_api_key, | ||
alpha_vantage_api_key=alpha_vantage_api_key) | ||
|
||
df = self._market.fetch_market(md_request=md_request) | ||
if df is None: | ||
md_request = MarketDataRequest(start_date=start_date, finish_date=finish_date, | ||
freq=freq, | ||
data_source=self._data_source, | ||
tickers=list(tickers.keys()), vendor_tickers=list(tickers.values()), | ||
fields=list(fields.keys()), | ||
vendor_fields=list(fields.values()), | ||
quandl_api_key=quandl_api_key, | ||
fred_api_key=fred_api_key, | ||
alpha_vantage_api_key=alpha_vantage_api_key) | ||
|
||
df = self._market.fetch_market(md_request=md_request) | ||
|
||
df = df.fillna(method='ffill') | ||
df.columns = [x.split('.')[0] for x in df.columns] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
trading strategies using a simple to use API, which has prebuilt templates for you to define backtest.""" | ||
|
||
setup(name='finmarketpy', | ||
version='0.11.4', | ||
version='0.11.5', | ||
description='finmarketpy is a Python based library for backtesting trading strategies', | ||
author='Saeed Amen', | ||
author_email='[email protected]', | ||
|