validate_latest_candles#
API documentation for tradeexecutor.strategy.pandas_trader.decision_trigger.validate_latest_candles Python function.
- validate_latest_candles(pairs, df, timestamp)[source]#
Ensure that the oracle served us correct up-to-date candles.
The last timestamp of a pair must match what we requested earlier.
The timestamp cannot be sooner or later
Note
This cam be only called for highly active pairs, as many low and middle cap tokens may not see trades in hours.
- Parameters:
df (DataFrame) –
Dataframe of candles.
May contain candes for a single or multiple pairs.
timestamp (datetime) – What is the latest timestamp we need to have avilable for every pair. This is the strategy decision timestamp - current candle time frame.
- Raise:
AssertionError