add websocket request/message schemas

This commit is contained in:
Timothy Pogue
2022-09-07 15:08:01 -06:00
parent 8bfaf0a998
commit 5934495dda
5 changed files with 165 additions and 82 deletions

View File

@@ -121,7 +121,8 @@ class DataProvider:
'type': RPCMessageType.ANALYZED_DF,
'data': {
'key': pair_key,
'value': (dataframe, datetime.now(timezone.utc))
'df': dataframe,
'la': datetime.now(timezone.utc)
}
}
)
@@ -130,7 +131,7 @@ class DataProvider:
self,
pair: str,
dataframe: DataFrame,
last_analyzed: Optional[str] = None,
last_analyzed: Optional[datetime] = None,
timeframe: Optional[str] = None,
candle_type: Optional[CandleType] = None,
producer_name: str = "default"
@@ -150,10 +151,7 @@ class DataProvider:
if producer_name not in self.__producer_pairs_df:
self.__producer_pairs_df[producer_name] = {}
if not last_analyzed:
_last_analyzed = datetime.now(timezone.utc)
else:
_last_analyzed = datetime.fromisoformat(last_analyzed)
_last_analyzed = datetime.now(timezone.utc) if not last_analyzed else last_analyzed
self.__producer_pairs_df[producer_name][pair_key] = (dataframe, _last_analyzed)
logger.debug(f"External DataFrame for {pair_key} from {producer_name} added.")