diff --git a/freqtrade/arguments.py b/freqtrade/arguments.py index 42275a4cc..d3168fc82 100644 --- a/freqtrade/arguments.py +++ b/freqtrade/arguments.py @@ -296,7 +296,7 @@ class Arguments(object): self.parser.add_argument( '--plot-dataframe-marker', - help='Renders the specified dataframes as markers', + help='Renders the specified dataframes as markers. Accepted values for a marker are either 100 or -100', dest='plotdataframemarker', default=None, nargs='+', diff --git a/scripts/plot_dataframe.py b/scripts/plot_dataframe.py index 9a9248c7c..794536365 100755 --- a/scripts/plot_dataframe.py +++ b/scripts/plot_dataframe.py @@ -29,6 +29,33 @@ from freqtrade.configuration import Configuration logger = logging.getLogger(__name__) +def plot_dataframes_markers(data, fig, args): + """ + plots additional dataframe markers in the main plot + :param data: + :param fig: + :param args: + :return: + """ + + if args.plotdataframemarker: + for x in args.plotdataframemarker: + filter = data[(data[x] == 100 ) | (data[x] == -100) ] + marker = go.Scatter( + x=filter.date, + y=filter.low * 0.99, + mode='markers', + name=x, + marker=dict( + symbol='diamond-tall-open', + size=10, + line=dict(width=1) + ) + + ) + + fig.append_trace(marker, 1, 1) + def plot_dataframes(data, fig, args): """ @@ -337,6 +364,7 @@ def plot_analyzed_dataframe(args: Namespace) -> None: # plot other dataframes plot_dataframes(data, fig, args) + plot_dataframes_markers(data, fig, args) fig['layout'].update(title=args.pair) fig['layout']['yaxis1'].update(title='Price')