add plot_config to startegy interface properly

This commit is contained in:
Matthias 2020-01-04 12:54:58 +01:00
parent b5a806dec7
commit bdda620397
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
import logging import logging
from pathlib import Path from pathlib import Path
from typing import Any, Dict, List, Union from typing import Any, Dict, List
import pandas as pd import pandas as pd
from freqtrade.configuration import TimeRange from freqtrade.configuration import TimeRange
@ -13,8 +13,6 @@ from freqtrade.resolvers import StrategyResolver
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
IndicatorType = Union[List[str], Dict[str, Dict]]
try: try:
from plotly.subplots import make_subplots from plotly.subplots import make_subplots
from plotly.offline import plot from plotly.offline import plot
@ -151,7 +149,8 @@ def plot_trades(fig, trades: pd.DataFrame) -> make_subplots:
return fig 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 Combines indicators 1 and indicators 2 into plot_config if necessary
:param indicators1: List containing Main plot indicators :param indicators1: List containing Main plot indicators

View File

@ -112,7 +112,8 @@ class IStrategy(ABC):
dp: Optional[DataProvider] = None dp: Optional[DataProvider] = None
wallets: Optional[Wallets] = 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: def __init__(self, config: dict) -> None:
self.config = config self.config = config