-
Notifications
You must be signed in to change notification settings - Fork 3.9k
throw 'weird error' #106
Comments
yep I got the same |
About the first error: Gekko is supposed to take a different codepath whenever it goes over midnight, which it did not. I think I need more information (so with debug on for example) to determine why it behaved that way. I had 3 instances running overnight and they all kept running fine through the midnight limit. About the second error: Gekko needs a full history, this means without any gaps. If Gekko crashes, you restart it 30 min later and on the first fetch Gekko is not able to fill the 30 min gap the old data is marked as corrupted (not deleted) because Gekko cannot use it at all anymore. |
Mike - just a hunch but perhaps the bug happens when a fetch spans midnight but there aren't any trades after midnight? I'll leave debug on overnight & see what we catch... The 2nd log was just to show what happened on a restart - I wasn't worried about the corrupt database message, although shouldn't it just fill that space with 'fake' candles? |
So there are a bunch of scenarios which are all a pain to deal with:
Internally Gekko keeps track of days by this thing called There are other situations though, which should get resolved:
No: fake candles are only for minutes in which Gekko knows no trades happened, so if we get a trade for min 10 and min 12 in a fetch we know that nothing happened in 11. But if Gekko stops at 3:00 and starts at 4:00 with the oldest fetchable trade happened at 3:40 than Gekko considers the data corrupt because it cannot know what happened in the other 40 minutes and thus cannot create any sane advice out of it. |
Thanks for the explanation on fake candles. |
I was just going to add a comment that it ran fine over midnight when I found this: 2014-01-02 11:31:56 (DEBUG): inserting candle 690 (2014-01-02 11:30:00 UTC) volume: 0.4149838699999998 D:\Users\David\Documents\GitHub\gekko\core\databaseManager.js:569 Update: cexio is down so that may have been the cause... |
Very strange, my CEX.io instance is handling the crashed API correctly. I'll debug the code a little more. |
Sorry I wasn't clear, once I restarted gekko it DID correctly just return the 'cexio is down retrying' message... |
Testing current version - failed again last night both on CEX and BTCe but at different times and not at midnight... |
This is getting frustating, I increased the logging around this error. Please posts logs when it happens again. |
and again - but only on BTCe, cexio ran over midnight OK......
|
If we reach a new day without having a previous fetch trigger the creation of a new day there is a possibility we reach a weird edge case where the expected most recent candle has a higher candle start point than the first candle in the batch. To prevent an infinite loop we force empty candles to be created for the new day.
Force creation of empty candles on new day. refs #106
This can be closed now? |
I've still encountered it sometimes in a weird scenario. But because of the big amount of edge cases I have now opted to rewrite some parts of the databaseManager to simplify some methods and make write tests for modularized pieces possible. After I've finished that I'll close this. EDIT: I am now rewriting that as we speak. |
Rewritten most of it, still errors in a situation I have not been able to figure out yet:
I've added more debug data so I can pinpoint this asap. Because I wasn't able to reproduce with fake data somehow. |
I know this is also mixed in with the stiff about the database rewrite but thought it should have a ticket!
Got the following at midnight again:
(ignore the extra logging etc - that's my WIP)
I turned debug logging back on and restarted and it worked OK... even though there were trades over the 2 days in the batch:
The text was updated successfully, but these errors were encountered: