add plot_config to startegy interface properly
This commit is contained in:
parent
b5a806dec7
commit
bdda620397
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user