update analyzed df request to allow specifying a single pair

This commit is contained in:
Timothy Pogue 2022-11-27 12:18:41 -07:00
parent 36a00e8de0
commit fce1e9d6d0
2 changed files with 3 additions and 2 deletions

View File

@ -91,9 +91,10 @@ async def _process_consumer_request(
elif type == RPCRequestType.ANALYZED_DF: elif type == RPCRequestType.ANALYZED_DF:
# Limit the amount of candles per dataframe to 'limit' or 1500 # Limit the amount of candles per dataframe to 'limit' or 1500
limit = min(data.get('limit', 1500), 1500) if data else None limit = min(data.get('limit', 1500), 1500) if data else None
pair = data.get('pair', None) if data else None
# For every pair in the generator, send a separate message # For every pair in the generator, send a separate message
for message in rpc._ws_request_analyzed_df(limit): for message in rpc._ws_request_analyzed_df(limit, pair):
# Format response # Format response
response = WSAnalyzedDFMessage(data=message) response = WSAnalyzedDFMessage(data=message)
await channel.send(response.dict(exclude_none=True)) await channel.send(response.dict(exclude_none=True))

View File

@ -1109,8 +1109,8 @@ class RPC:
def _ws_request_analyzed_df( def _ws_request_analyzed_df(
self, self,
pair: Optional[str],
limit: Optional[int] = None, limit: Optional[int] = None,
pair: Optional[str] = None
): ):
""" Historical Analyzed Dataframes for WebSocket """ """ Historical Analyzed Dataframes for WebSocket """
pairlist = [pair] if pair else self._freqtrade.active_pair_whitelist pairlist = [pair] if pair else self._freqtrade.active_pair_whitelist