-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect ohlc on fetching during live trading #34
Comments
Hi @dimnorin, it works great with your fix. I also had the same issue and with your fix, now it works. It is actually related to bug #17 and it could be fixed by adding the following codes in ccxtfeed.py -> _load as suggested by @LatchRazu :
Details can be found in issue #17. Unfortunately, the above fix is not compatible with your fix. When I combined both, the min() arg error occurs. Do you have any idea why it is not compatible with your fix? |
This is only an issue on certain exchanges right? I run on bitmex and get all the ohlcv data. @dimnorin I think your fix might be redundant. If I'm not mistaken ccxtfeed's 'drop_newest' param is supposed to fix this @JiazhengChai This is a well known issue with backtrader. Any manipulation of the datafeed tends to screw things up when resampling data. (activating memory savings with resampled data causes the same problem) You can prevent the crash by adding this piece of code in Cerebro but I haven't tested if it screws up your data.
So try out if this fix and see if your data get scrambled or not. If it does, I'd suggest moving to an exchange which doesn't provide incomplete candles. I'll try debugging it for a bit but it's an absolute nightmare so don't get your hopes up. |
@LatchRazu Yeah, I agree with the resampling problem when saving memory. So your crash prevention fix is to set all other timeframe's dret to False when the base timeframe value is None, am I right? Thanks for your help. I appreciate it. |
I've been trading/testing on bitmex for months and after adding the sleep fix and adding extensive error handling in the retry method, I haven't experienced any crashes or issues from the ccxt store. |
While running live trading ohlc data incorrectly pushed to lines.
Please view the image. The left part is prefetched data, the right part - live data.
The text was updated successfully, but these errors were encountered: