From f3ba3ddd54f608b74bcd6e315aa21f719270503b Mon Sep 17 00:00:00 2001 From: gcarq Date: Tue, 21 Nov 2017 20:41:49 +0100 Subject: [PATCH] move buy_price and sell_price to plotting script --- freqtrade/analyze.py | 3 --- scripts/plot_dataframe.py | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/analyze.py b/freqtrade/analyze.py index 30de537ae..7323357e6 100644 --- a/freqtrade/analyze.py +++ b/freqtrade/analyze.py @@ -107,9 +107,6 @@ def analyze_ticker(pair: str) -> DataFrame: dataframe = populate_indicators(dataframe) dataframe = populate_buy_trend(dataframe) dataframe = populate_sell_trend(dataframe) - # TODO: buy_price and sell_price are only used by the plotter, should probably be moved there - dataframe.loc[dataframe['buy'] == 1, 'buy_price'] = dataframe['close'] - dataframe.loc[dataframe['sell'] == 1, 'sell_price'] = dataframe['close'] return dataframe diff --git a/scripts/plot_dataframe.py b/scripts/plot_dataframe.py index 32d9b3cfa..eeabda007 100755 --- a/scripts/plot_dataframe.py +++ b/scripts/plot_dataframe.py @@ -18,6 +18,9 @@ def plot_analyzed_dataframe(pair: str) -> None: exchange._API = exchange.Bittrex({'key': '', 'secret': ''}) dataframe = analyze.analyze_ticker(pair) + dataframe.loc[dataframe['buy'] == 1, 'buy_price'] = dataframe['close'] + dataframe.loc[dataframe['sell'] == 1, 'sell_price'] = dataframe['close'] + # Two subplots sharing x axis fig, (ax1, ax2, ax3) = plt.subplots(3, sharex=True) fig.suptitle(pair, fontsize=14, fontweight='bold')