Subplots should always be included in responses
This commit is contained in:
parent
ff7bbec1bc
commit
09756e3007
@ -268,7 +268,7 @@ class DeleteTrade(BaseModel):
|
|||||||
|
|
||||||
class PlotConfig_(BaseModel):
|
class PlotConfig_(BaseModel):
|
||||||
main_plot: Dict[str, Any]
|
main_plot: Dict[str, Any]
|
||||||
subplots: Optional[Dict[str, Any]]
|
subplots: Dict[str, Any]
|
||||||
|
|
||||||
|
|
||||||
class PlotConfig(BaseModel):
|
class PlotConfig(BaseModel):
|
||||||
|
@ -845,5 +845,7 @@ class RPC:
|
|||||||
df_analyzed, arrow.Arrow.utcnow().datetime)
|
df_analyzed, arrow.Arrow.utcnow().datetime)
|
||||||
|
|
||||||
def _rpc_plot_config(self) -> Dict[str, Any]:
|
def _rpc_plot_config(self) -> Dict[str, Any]:
|
||||||
|
if (self._freqtrade.strategy.plot_config and
|
||||||
|
'subplots' not in self._freqtrade.strategy.plot_config):
|
||||||
|
self._freqtrade.strategy.plot_config['subplots'] = {}
|
||||||
return self._freqtrade.strategy.plot_config
|
return self._freqtrade.strategy.plot_config
|
||||||
|
@ -1142,6 +1142,14 @@ def test_api_plot_config(botclient):
|
|||||||
assert_response(rc)
|
assert_response(rc)
|
||||||
assert rc.json() == ftbot.strategy.plot_config
|
assert rc.json() == ftbot.strategy.plot_config
|
||||||
assert isinstance(rc.json()['main_plot'], dict)
|
assert isinstance(rc.json()['main_plot'], dict)
|
||||||
|
assert isinstance(rc.json()['subplots'], dict)
|
||||||
|
|
||||||
|
ftbot.strategy.plot_config = {'main_plot': {'sma': {}}}
|
||||||
|
rc = client_get(client, f"{BASE_URI}/plot_config")
|
||||||
|
assert_response(rc)
|
||||||
|
|
||||||
|
assert isinstance(rc.json()['main_plot'], dict)
|
||||||
|
assert isinstance(rc.json()['subplots'], dict)
|
||||||
|
|
||||||
|
|
||||||
def test_api_strategies(botclient):
|
def test_api_strategies(botclient):
|
||||||
|
Loading…
Reference in New Issue
Block a user