I have a trading bot using a combination of Stochastic, RSI and MACD which is running in a loop every minute and calling get_historical_klines_generator to get the last x closes for 1m candles and relevant info to then be analyzed using TA in python to look for buy and sell signals. This has been running fine for around 1 month, but stopped working on Saturday night / Sunday morning this weekend. The call is successful but returns an empty data frame.
It may be totally unrelated, but the timing of when it stopped working is exactly at the point when the UK moved from GMT to BST (clocks went forward by 1 hour at 01:00 GMT on Sunday 27th March). The bot is working fine for other intervals (e.g. 15m ETHUSDT), but cannot get data for 1m candles using get_historical_klines_generator. If I make a call now, it still brings back an empty data frame.
Any pointers? May be something to do with the timestamp parameter I am passing, but don’t see how anything has changed there.
OK - school boy error. It was indeed related to the daylight savings shift - I am passing the current timestamp minus 40 mins to get the last 40 x 1m candles. I didn’t adjust the timestamp to GMT and so when I now pass a BST timestamp minus 40 mins to Binance, the API thinks it’s in the future!
Fixed by adjusting timestamp to GMT before sending.