From 9bd5aff87971a0e93543a9de779dae16c91210d6 Mon Sep 17 00:00:00 2001 From: froggleston Date: Mon, 29 Apr 2024 14:50:48 +0100 Subject: [PATCH] Add new column selection to ft_rest_client pair_candles --- ft_client/freqtrade_client/ft_rest_client.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ft_client/freqtrade_client/ft_rest_client.py b/ft_client/freqtrade_client/ft_rest_client.py index 20e6d6f6e..56290a9d8 100755 --- a/ft_client/freqtrade_client/ft_rest_client.py +++ b/ft_client/freqtrade_client/ft_rest_client.py @@ -397,12 +397,13 @@ class FtRestClient: "timeframe": timeframe if timeframe else '', }) - def pair_candles(self, pair, timeframe, limit=None): + def pair_candles(self, pair, timeframe, limit=None, columns=None): """Return live dataframe for . :param pair: Pair to get data for :param timeframe: Only pairs with this timeframe available. :param limit: Limit result to the last n candles. + :param columns: List of dataframe columns to return. Empty list will return OHLCV. :return: json object """ params = { @@ -411,6 +412,14 @@ class FtRestClient: } if limit: params['limit'] = limit + + if columns is not None: + params['columns'] = columns + return self._post( + "pair_candles", + data=params + ) + return self._get("pair_candles", params=params) def pair_history(self, pair, timeframe, strategy, timerange=None, freqaimodel=None):