Add timeframe to candle return values
This commit is contained in:
parent
a3d0889dab
commit
4b6b7f8343
@ -656,8 +656,8 @@ class RPC:
|
|||||||
raise RPCException('Edge is not enabled.')
|
raise RPCException('Edge is not enabled.')
|
||||||
return self._freqtrade.edge.accepted_pairs()
|
return self._freqtrade.edge.accepted_pairs()
|
||||||
|
|
||||||
def _convert_dataframe_to_dict(self, strategy: str, pair: str, dataframe: DataFrame,
|
def _convert_dataframe_to_dict(self, strategy: str, pair: str, timeframe: str,
|
||||||
last_analyzed: datetime) -> Dict[str, Any]:
|
dataframe: DataFrame, last_analyzed: datetime) -> Dict[str, Any]:
|
||||||
has_content = len(dataframe) != 0
|
has_content = len(dataframe) != 0
|
||||||
if has_content:
|
if has_content:
|
||||||
|
|
||||||
@ -673,6 +673,8 @@ class RPC:
|
|||||||
|
|
||||||
res = {
|
res = {
|
||||||
'pair': pair,
|
'pair': pair,
|
||||||
|
'timeframe': timeframe,
|
||||||
|
'timeframe_ms': timeframe_to_msecs(timeframe),
|
||||||
'strategy': strategy,
|
'strategy': strategy,
|
||||||
'columns': list(dataframe.columns),
|
'columns': list(dataframe.columns),
|
||||||
'data': dataframe.values.tolist(),
|
'data': dataframe.values.tolist(),
|
||||||
@ -701,7 +703,7 @@ class RPC:
|
|||||||
if limit:
|
if limit:
|
||||||
_data = _data.iloc[-limit:]
|
_data = _data.iloc[-limit:]
|
||||||
return self._convert_dataframe_to_dict(self._freqtrade.config['strategy'],
|
return self._convert_dataframe_to_dict(self._freqtrade.config['strategy'],
|
||||||
pair, _data, last_analyzed)
|
pair, timeframe, _data, last_analyzed)
|
||||||
|
|
||||||
def _rpc_analysed_history_full(self, config: Dict[str, any], pair: str, timeframe: str,
|
def _rpc_analysed_history_full(self, config: Dict[str, any], pair: str, timeframe: str,
|
||||||
timerange: str) -> Dict[str, Any]:
|
timerange: str) -> Dict[str, Any]:
|
||||||
@ -718,8 +720,8 @@ class RPC:
|
|||||||
strategy = StrategyResolver.load_strategy(config)
|
strategy = StrategyResolver.load_strategy(config)
|
||||||
df_analyzed = strategy.analyze_ticker(_data[pair], {'pair': pair})
|
df_analyzed = strategy.analyze_ticker(_data[pair], {'pair': pair})
|
||||||
|
|
||||||
return self._convert_dataframe_to_dict(strategy.get_strategy_name(), pair, df_analyzed,
|
return self._convert_dataframe_to_dict(strategy.get_strategy_name(), pair, timeframe,
|
||||||
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]:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user