-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Unable to get historical data from CEX.io #90
Comments
looking forward for the CEX.io historical data fix. I truly congratulate you for an outstanding dev, this project is awesome! Nico |
Thanks! I am working on a new version of Gekko that is able to store history locally, this means it is able to monitor:
So far I have written the functionality that can monitor the exchange and store candles. If people could test it that would be awesome! Test new Gekko
|
Is this okay ? gekko-localDB : node gekko.js 2013-12-24 10:48:25 (INFO): I'm gonna make you rich, Bud Fox. 2013-12-24 10:48:25 (INFO): Let me show you some Exponential Moving Averages. 2013-12-24 10:48:25 (INFO): Using normal settings to monitor the live market 2013-12-24 10:48:25 (INFO): NOT trading with real money 2013-12-24 10:48:25 (INFO): Starting to watch the market: CEX.io BTC/GHS 2013-12-24 10:48:25 (DEBUG): Scheduling next fetch: in 1 minutes 2013-12-24 10:48:25 (DEBUG): Fetched 1001 new trades, from 09:29:18 (UTC) to 09:48:23 (UTC) 2013-12-24 10:48:25 (DEBUG): Creating a new daily database for day 2013-12-24 2013-12-24 10:48:25 (DEBUG): inserting candle 569 (09:29:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 570 (09:30:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 571 (09:31:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 572 (09:32:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 573 (09:33:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 574 (09:34:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 575 (09:35:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 576 (09:36:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 577 (09:37:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 578 (09:38:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 579 (09:39:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 580 (09:40:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 581 (09:41:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 582 (09:42:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 583 (09:43:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 584 (09:44:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 585 (09:45:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 586 (09:46:00 UTC) 2013-12-24 10:48:25 (DEBUG): inserting candle 587 (09:47:00 UTC) 2013-12-24 10:48:25 (DEBUG): Leftovers: 588 2013-12-24 10:49:26 (DEBUG): Scheduling next fetch: in 1 minutes 2013-12-24 10:49:26 (DEBUG): Fetched 1001 new trades, from 09:29:52 (UTC) to 09:49:25 (UTC) 2013-12-24 10:49:26 (DEBUG): inserting candle 588 (09:48:00 UTC) 2013-12-24 10:49:26 (DEBUG): Leftovers: 589 2013-12-24 10:50:27 (DEBUG): Scheduling next fetch: in 1 minutes 2013-12-24 10:50:27 (DEBUG): Fetched 1001 new trades, from 09:29:52 (UTC) to 09:50:26 (UTC) 2013-12-24 10:50:27 (DEBUG): inserting candle 589 (09:49:00 UTC) 2013-12-24 10:50:27 (DEBUG): Leftovers: 590 2013-12-24 10:51:27 (DEBUG): Scheduling next fetch: in 1 minutes |
Thanks for testing :) Looks great, I'll explain some things:
One small thing I am going to look into though: It shouldn't fetch once every minute (doesn't cause any trouble, but a lot of overhead). |
I configured it to fetch every minute, and run in debug mode to get some activity on stdout ;-) |
Ah, that explains it. And the answers were also for clarifying the new logic for everyone. On CEX.io [and BTC-e] you only get the last 1000 [or 150] trades, whether they happened in a minute or over the last hour. This makes it quite hard to determine when to fetch. But I quite like how the current setup deals with it: after every fetch it calculates a new fetchtime based on trades/min from the previous fetch. It appears to do well but it needs to prove itself over langer periods of time. Here is a log where you can see this in action:
I do want to make it more aggressive, missing trades is not acceptable. |
I like it ! |
Well this new change means that I need to rewrite how Gekko deals with data under the hood. Both the I am working on it, but it's a lot of work. |
I downloaded the localDB version and ran some test, but it only seems to monitor candle behaviour, is that right? |
Is the test version able to trade yet or is it just at the candle/advice section for now ? |
Hey - CEX seems to be running fine, but I get this error when I try to launch with Mt. Gox now (this is with debug turned on):
|
@bppsp1 nope, not yet. I'll gladly accept pull requests though :) @streetlogics, the code works in that it takes different paths for different situations, the situations are:
I am still finishing up the first scenario. Though because you can always request historical data from Mt. Gox, you can do anything I'm trying to achieve already (except store the historical data) using the master branch. |
Cool cool - no worries if you're aware of it then, just wanted to let you know just in case. Happy to test again on the branch once it's implemented. |
Mike - looking forward to the trade engine implementation... Just another suggestion while looking at candle generation - would it be possible to also store volume weighted price (VWP) as well and also to give the option to use this in calcs rather than the centre price? This would mean iterating the trade data set but this could be calculated when assigning them to candles (and wouldn't it be as easy to pick up the OHCL figures at this point rather than using first/last/min/max later?) Thanks |
kwest$ node gekko 2013-12-28 16:37:15 (INFO): Using normal settings to monitor the live market /Users/kwest/gekko/gekko.js:60 |
ok
|
@kkwestt I consider it stable when it runs a while on busy markets as well as empty ones. Could you let me know if it crashes or anything like that? I think I got it almost stable now:
|
The latest tip of localdb is borking out with JS Allocation failed - process out of memory - trying to track down what & where currently.. |
@dasher very strange? Could you post (or link to) the output with debug enabled? Haven't seen that behaviour yet. Also: on what market is this happening and do you have a history build up with previous versions? |
I started running localDB branch yesterday on two instances. Both of them was crached on last night. ---------------------------------------- First instance ---------------------------------------- Last lines from log:
When I started it again:
---------------------------------------- Second instance ----------------------------------------
Last lines from log:
Works after restart but probably will crash on next night again. Anyway. I will now update latest version and try again. |
@GoodDragon that should have been resolved by this commit. Let me know what happens next time. @yin Totally agree, though because of the huge todo I have not written tests yet. Also because of the hard to test edgecases around having parted history / receiving weird fetch data it's hard to write bullet proof testing. Though I'm very interested in building a test suite asap. Pull requests more than welcome! |
Already working on tests, well one is already passing - Store.read(). I I used nodeunit, so we can have test framework and examples at hand. Have a https://github.com/yin/gekko/commits/localDB I'd also copy in my timing code from yesterday as a nice module. Regards / S pozdravom Matej Gagyi On Tue, Dec 31, 2013 at 3:28 PM, Mike van Rossum
|
I've got the local database version up and running, but it won't let me change out of BTC/TRC....
when I change to
I get this:
am I missing something obvious? haven't seen anyone else mention this... |
@ArgyleEl1te it seems you are using the wrong quotes, they should not be curly but normal ones. (if unsure copy quotes from somewhere else and change the Note that Gekko watches per market, so you do need to rebuild a history for this other one. |
@askmike wow... not sure how that happened. Even copied and pasted out of the old config.js from the previous version... but yes, you are right. Wiped out databases, it fired up, excited to see how it goes. Thanks for the 5 minute help turnaround! |
Ran for about 4 hours, then threw this error and crashed: 2013-12-31 17:59:53 (INFO): Processed trades, sleeping for 2 minutes ... TypeError: Cannot set property 's' of undefined Loaded it back up and it gave me this: 2013-12-31 19:16:43 (INFO): Starting to watch the market: BTC-e USD/BTC 2013-12-31 19:16:43 (INFO): Seting up a new price actor: 2013-12-31 19:16:48 (DEBUG): Fetched 150 new trades, from 2014-01-01 00:48:42 (UTC) to 2014-01-01 01:16:24 (UTC) So, corrupted database somehow.... FYI... |
@ArgyleEl1te hmm the first error is weird, let me know if it still happens... For the second one I am going to write a document explaining the issue, but it boils down to: it's not really corrupt but just incomplete: You started it 75 minutes after the crash, but BTC-e most likely won't tell you what happened before a couple of minutes.
So I created a new issue that hosts the TODO before I consider all the localDB stuff stable (and will merge this into master): |
Hi. Didn't follow up the whole discussion, but the app told me, I should contact you 😕
Btw: Local time was 20:08 (MEZ/GMT+1) |
Awesome thanks! So my question is: did it crash it did it work? |
@askmike Actually it looks like it works. At least no crash. 😉 |
May I recommend removing the "If you see this please let me know the following:" |
@trader-cheat-codes I'm still working on that code and there still is one situation where it crashes after that. Gonna be out soon! |
i have this error : user@host: do I have a mistake or a problem with the source? |
@ejko it depends a little on what you want:
|
Hey, Ran the Gekko-LocalDB for 48 hours to monitor LTC-USD with no isseus. Not sure if you need a log from a working one? Cant wait to test the Auto Trade future for Altcoin! :) With friendly Regards, |
I apologize again, I'm new in this system. |
Because the unstable and unverified state of the new version I've disabled real trading for now. All code is located in another branch (like a nightly build), to get it download and install git and run:
and follow instructions in the readme. |
hope this helps 2014-01-27 04:53:45 (INFO): I'm gonna make you rich, Bud Fox. 2014-01-27 04:53:45 (INFO): Setting up Gekko in realtime mode 2014-01-27 04:53:45 (INFO): Setting up: 2014-01-27 04:53:45 (INFO): Setting up: 2014-01-27 04:53:46 (INFO): Setting up: 2014-01-27 04:53:48 (INFO): Starting to watch the market: BTC-e BTC/USD /home/pi/gekko-localDB/core/candleManager.js:898 |
Excited to announce that the new localDB branch is out. Trading is CEX.io is working and stable. |
Since a couple of days the CEX.io API does not give back old trades anymore (using the since parameter). After contacting support they stated:
Which means that until the static file is offered we need to redesign CEX.io implementation to:
config.EMA.candles
*config.EMA.interval
) start giving advice and trade.The text was updated successfully, but these errors were encountered: