TradingView-API icon indicating copy to clipboard operation
TradingView-API copied to clipboard

FakeReplay always returning the same day

Open LuanG01 opened this issue 3 years ago • 7 comments

Describe the bug FakeReplay function is rarely working as Im getting returned the same day most of the time.

To Reproduce Basically just using the FakeReplay.js of the examples / test folder

Screenshots image

Why is that and is the normal premium feature replay the same or is it worth it upgrading and using the "real" replay function instead? Would be bad if I buy premium and the bug isnt fixed with the replay function.

LuanG01 avatar May 31 '22 19:05 LuanG01

Yeah, I've seen it do that, but I don't know why... Maybe it happens when you call fetchMore too quickly. The real replay mode hasn't this problem (you can test it for free with Day, Week and Month timeframes). I don't know if it's worth upgrading since it's seems possible to get the FakeReplayMode to work.

Mathieu2301 avatar May 31 '22 21:05 Mathieu2301

Ive justed tested the real replay feature and the same thing happens there. Im getting returned the same day multiple times and after that it skips a few days which results into this error:

Wrong interval: 259200 (should be 86400)

I want to backtest my strategy for the last 90 days in the 5 minute timeframe in the future. Will this be possible?

LuanG01 avatar Jun 01 '22 18:06 LuanG01

returned the same day multiple times

Ohh that's weird...

after that it skips a few days

Sometimes it skips when the market is closed (weekends).

I don't know, it's a bit strange behavior, I've never had to deal with it.

Mathieu2301 avatar Jun 01 '22 19:06 Mathieu2301

Sometimes it skips when the market is closed (weekends).

Im testing it on crypto so the market is never closed actually

I don't know, it's a bit strange behavior, I've never had to deal with it.

Ye it is. I have tested it a few more times now. It seems to occur when I "spam" the replay function. After I wait a few minutes it works fine again. Really strange

LuanG01 avatar Jun 01 '22 20:06 LuanG01

Hmm I see but when I try it works... image I tried with/without indicators, with normal/pro account and it works...

Mathieu2301 avatar Jun 01 '22 20:06 Mathieu2301

So strange. Its not that big of a deal for now as it works most of the time. I will give an update in case it happens more often.

Edit: A screenshot in case it helps image

LuanG01 avatar Jun 01 '22 20:06 LuanG01

Update: Just bought Premium and wanted to backtest my strategy in the 15 minute timeframe and 90 days before now. I am not even getting close to the current date. Randomly getting the above error every run which is really frustrating.

The maximum I was getting was around 600 calls of the step() function.

LuanG01 avatar Jun 02 '22 15:06 LuanG01