TradingView-API
TradingView-API copied to clipboard
Replaying old time with both "replay" and "to" set seems to repeat same time
Describe the bug
Setting both replay
and to
appears to cause the replay mode to play the same candle repeatedly.
To Reproduce Go to the ReplayMode example, and use the following config:
const config = {
symbol: 'BINANCE:BTCEUR',
timeframe: 'D',
startFrom: Math.round(Date.now() / 1000) - 86400 * 303, // 303 days before
to: Math.round(Date.now() / 1000) - 86400 * 205 // 205 days before
}
The output will look something like this:
Next -> 1634342400 0
Next -> 1634342400 1
Next -> 1634342400 1
Next -> 1634342400 1
Next -> 1634342400 1
Next -> 1634342400 1
Next -> 1634342400 1
...
Expected behavior I would expect the 1st candle to be from 303 days in the past, and have progressing candles until 205 days in the past.
Environment:
- OS: Windows 10 using Ubuntu 18.04
- Node version: v16.15.1
Additional context Removing the "to" from the config works as expected.