From f420994006677b84e2122ec809f3c4abe41a8668 Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Sun, 6 May 2018 17:32:24 -0700 Subject: [PATCH] added support to defined custom clipping --- freqtrade/arguments.py | 16 ++++++++++++++++ scripts/plot_dataframe.py | 16 ++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/freqtrade/arguments.py b/freqtrade/arguments.py index a4f32411d..42275a4cc 100644 --- a/freqtrade/arguments.py +++ b/freqtrade/arguments.py @@ -291,7 +291,16 @@ class Arguments(object): default=None, nargs='+', type=str + ) + + self.parser.add_argument( + '--plot-dataframe-marker', + help='Renders the specified dataframes as markers', + dest='plotdataframemarker', + default=None, + nargs='+', + type=str ) self.parser.add_argument( @@ -302,5 +311,12 @@ class Arguments(object): ) + self.parser.add_argument( + '--plot-max-ticks', + help='specify an upper limit of how many ticks we can display', + dest='plotticks', + default=750, + type=int + ) diff --git a/scripts/plot_dataframe.py b/scripts/plot_dataframe.py index d187aa037..9a9248c7c 100755 --- a/scripts/plot_dataframe.py +++ b/scripts/plot_dataframe.py @@ -39,9 +39,10 @@ def plot_dataframes(data, fig, args): :return: """ - for x in args.plotdataframe: - chart = go.Scattergl(x=data['date'], y=data[x], name=x) - fig.append_trace(chart, 1, 1) + if args.plotdataframe: + for x in args.plotdataframe: + chart = go.Scattergl(x=data['date'], y=data[x], name=x) + fig.append_trace(chart, 1, 1) def plot_volume_dataframe(data, fig, args, plotnumber): @@ -114,6 +115,9 @@ def plot_stop_loss_trade(df_sell, fig, analyze, args): if args.stoplossdisplay is False: return + if 'associated_buy_price' not in df_sell: + return + stoploss = analyze.strategy.stoploss for index, x in df_sell.iterrows(): @@ -231,9 +235,9 @@ def plot_analyzed_dataframe(args: Namespace) -> None: dataframe = analyze.populate_buy_trend(dataframe) dataframe = analyze.populate_sell_trend(dataframe) - if len(dataframe.index) > 750: - logger.warning('Ticker contained more than 750 candles, clipping.') - data = dataframe.tail(750) + if len(dataframe.index) > args.plotticks: + logger.warning('Ticker contained more than {} candles, clipping.'.format(args.plotticks)) + data = dataframe.tail(args.plotticks) candles = go.Candlestick( x=data.date,