From bdda62039752c967ae51e3717958bb282f825c18 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 4 Jan 2020 12:54:58 +0100 Subject: [PATCH] add plot_config to startegy interface properly --- freqtrade/plot/plotting.py | 7 +++---- freqtrade/strategy/interface.py | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/freqtrade/plot/plotting.py b/freqtrade/plot/plotting.py index 1c8ad552f..39629fe21 100644 --- a/freqtrade/plot/plotting.py +++ b/freqtrade/plot/plotting.py @@ -1,6 +1,6 @@ import logging from pathlib import Path -from typing import Any, Dict, List, Union +from typing import Any, Dict, List import pandas as pd from freqtrade.configuration import TimeRange @@ -13,8 +13,6 @@ from freqtrade.resolvers import StrategyResolver logger = logging.getLogger(__name__) -IndicatorType = Union[List[str], Dict[str, Dict]] - try: from plotly.subplots import make_subplots from plotly.offline import plot @@ -151,7 +149,8 @@ def plot_trades(fig, trades: pd.DataFrame) -> make_subplots: return fig -def create_plotconfig(indicators1: List[str], indicators2: List[str], plot_config: Dict[str, Dict]) -> Dict[str, Dict]: +def create_plotconfig(indicators1: List[str], indicators2: List[str], + plot_config: Dict[str, Dict]) -> Dict[str, Dict]: """ Combines indicators 1 and indicators 2 into plot_config if necessary :param indicators1: List containing Main plot indicators diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index a2dee7837..7bd6a9ac5 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -112,7 +112,8 @@ class IStrategy(ABC): dp: Optional[DataProvider] = None wallets: Optional[Wallets] = None - plot_config: Dict + # Definition of plot_config. See plotting documentation for more details. + plot_config: Dict = {} def __init__(self, config: dict) -> None: self.config = config