Emit a simple "new candle" message to allow UI's to refresh charts
This commit is contained in:
@@ -101,16 +101,13 @@ class DataProvider:
|
||||
"""
|
||||
return self.__producer_pairs.get(producer_name, []).copy()
|
||||
|
||||
def _emit_df(
|
||||
self,
|
||||
pair_key: PairWithTimeframe,
|
||||
dataframe: DataFrame
|
||||
) -> None:
|
||||
def _emit_df(self, pair_key: PairWithTimeframe, dataframe: DataFrame, new_candle: bool) -> None:
|
||||
"""
|
||||
Send this dataframe as an ANALYZED_DF message to RPC
|
||||
|
||||
:param pair_key: PairWithTimeframe tuple
|
||||
:param data: Tuple containing the DataFrame and the datetime it was cached
|
||||
:param dataframe: Dataframe to emit
|
||||
:param new_candle: This is a new candle
|
||||
"""
|
||||
if self.__rpc:
|
||||
self.__rpc.send_msg(
|
||||
@@ -123,6 +120,15 @@ class DataProvider:
|
||||
}
|
||||
}
|
||||
)
|
||||
if new_candle:
|
||||
self.__rpc.send_msg(
|
||||
{
|
||||
'type': RPCMessageType.NEW_CANDLE,
|
||||
'data': {
|
||||
'key': pair_key,
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
def _add_external_df(
|
||||
self,
|
||||
|
Reference in New Issue
Block a user