Pages:
Author

Topic: Gekko - a javascript trading bot and backtesting platform - page 16. (Read 147846 times)

newbie
Activity: 41
Merit: 0
I got "registry error parsing json". How to fix that if it happens in the stable version update?

That's weird. So Gekko runs on Nodejs which is a platform for developers, I'm sorry I can't offer a more user friendly solution at this moment.

To troubleshoot:

- What OS are you running?
- What's the output of running: node -v
- What's the output of running: npm -v

I'm on Windows 7 64-bit.
node -v 0.10.24
npm -v 1.3.21

If something is currently wrong with my OS (even though that's unlikely) I can try on AWS.
sr. member
Activity: 287
Merit: 250
I got "registry error parsing json". How to fix that if it happens in the stable version update?

That's weird. So Gekko runs on Nodejs which is a platform for developers, I'm sorry I can't offer a more user friendly solution at this moment.

To troubleshoot:

- What OS are you running?
- What's the output of running: node -v
- What's the output of running: npm -v
newbie
Activity: 41
Merit: 0

Every time you pull the latest version of gekko you need to run:

Code:
npm update


I got "registry error parsing json". How to fix that if it happens in the stable version update?
sr. member
Activity: 287
Merit: 250
Also hey @whydifficult I was figlet-ing some big ASCII text for something unrelated and I thought maybe you'd like a splashier splashscreen?

Code:
.d888888 .d8888b. 88  .dP 88  .dP .d8888b.
88'  '88 88ooood8 88888"  88888"  88'  '88
'8888P88 '8boood' 88  '8b.88  '8b.'88888P'
     .88
 d8888P   I'm gonna make you rich, Bud Fox.

This looks awesome! Will look into this thanks Smiley

Hi
I recently installed the latest version your bot using the windows guide but i have troubles when i want to use kraken, i get a "Cannot find module 'kraken-api' "
But at least the bots works for other platform like MtGox where it can connect. So i guess its just a problem with kraken
Im using node v0.10.25.
If someone can give me an advice ? Thanks

Every time you pull the latest version of gekko you need to run:

Code:
npm update

okey i success to make it run on my computer finnally...
this bot is not really as "intuitive" to make it run as others like butter bot,

any way, is the tutorial data updated? because i use LTC asset and i get an error as its not supported at btc-e...

i am also trying to find the code:

config.tradingAdvisor = {
  enabled: true,
  method: 'DEMA',
  candleSize: 5,
  historySize: 20
}


as i read in the tutorial and it does not exist at config.js...

So altcoin support is only available in the latest unstable build: we changed a lot of things in Gekko and don't know for 100% everything works. You can find the latest version here:

https://github.com/askmike/gekko/tree/localDB

You can only download this unstable nightly build through git. First download git than:

Code:
git clone -b localDB --single-branch git://github.com/askmike/gekko

(As soon as this version is stable you can download normally)

and the configuring docs:

https://github.com/askmike/gekko/blob/localDB/docs/Configuring_gekko.md

--

So you are looking at the docs for the new version, though you are trying to run it on the old version.
newbie
Activity: 59
Merit: 0
okey i success to make it run on my computer finnally...
this bot is not really as "intuitive" to make it run as others like butter bot,

any way, is the tutorial data updated? because i use LTC asset and i get an error as its not supported at btc-e...

i am also trying to find the code:

config.tradingAdvisor = {
  enabled: true,
  method: 'DEMA',
  candleSize: 5,
  historySize: 20
}


as i read in the tutorial and it does not exist at config.js...
hero member
Activity: 824
Merit: 1000
Hi
I recently installed the latest version your bot using the windows guide but i have troubles when i want to use kraken, i get a "Cannot find module 'kraken-api' "
But at least the bots works for other platform like MtGox where it can connect. So i guess its just a problem with kraken
Im using node v0.10.25.
If someone can give me an advice ? Thanks
sr. member
Activity: 462
Merit: 250
I love that splash screen!
member
Activity: 112
Merit: 10
Be kind man, don't be mankind
if you are a whale slippage will eat in your profits hard after the top ask

It's not hard to be a semi-whale at cex, because when it flatlines, it reeeeeally flatlines, and you can see your own trades shunt the candles with well under 1BTC.

Also hey @whydifficult I was figlet-ing some big ASCII text for something unrelated and I thought maybe you'd like a splashier splashscreen?

Code:
.d888888 .d8888b. 88  .dP 88  .dP .d8888b.
88'  '88 88ooood8 88888"  88888"  88'  '88
'8888P88 '8boood' 88  '8b.88  '8b.'88888P'
     .88
 d8888P   I'm gonna make you rich, Bud Fox.
sr. member
Activity: 287
Merit: 250
I'm not sure, but does Gekko simulation take transaction fees into account? That might be the reason for your discrepancy. I also find it surprising you trade succesfully at cex. I thought that market only had one direction... down...

Yes, Gekko also takes fees into account. Though CEX.io doesn't have any trading fees. The different either comes from a calculation bug (I'm skeptical about this) or fees + slippage.

Currently the simulator assumes it's able to buy/sell at current market price (which is last trade price, does not look at the book) - fees - slippage. If the spread is large and the trade was on the other side of the book this is far removed from reality if slippage is not set accordingly (don't trust the defaults as this is way to market specific). The reason it doesn't look at the book now is because the system is agnostic to any live market: if you feed it a stream of trades it is able to simulate new trades according to the configured trading method. Eg. this also works for backtesting as is. I want to move to a system where we also save a historical ticker data.

Note that only having ticker data does not prevent not being accurately able to calculate slippage, just the part up to the spread (difference between last price and best ask in case of long), but if you are a whale slippage will eat in your profits hard after the top ask (which is the only information the ticker provides).
sr. member
Activity: 462
Merit: 250
Looks nice indeed! Interesting!
member
Activity: 112
Merit: 10
Be kind man, don't be mankind
I'm not sure, but does Gekko simulation take transaction fees into account? That might be the reason for your discrepancy. I also find it surprising you trade succesfully at cex. I thought that market only had one direction... down...

No tx fees @ cex. It's an overall downslope trend there fersure as GHS gets cheaper outside of cex, but there are enough ups in their graph to make it worthwhile for gekko. Any motion, up or down, is technically a gain with a bot watching things. Plus the mining.

http://bitcoinwisdom.com/markets/cexio/ghsbtc

mmm, ups and downs.

Edit: in fact gekko is doing well on cex to the point where it's now visible in my cex hashing speed graph.
(each blip is an hour's average, so the low peaks don't mean losses, just mucho activity. The high peaks are the important bit.)

sr. member
Activity: 462
Merit: 250
member
Activity: 112
Merit: 10
Be kind man, don't be mankind
It's a convoluted quote-a-thon!

Awesome let me know how it goes. You can always set the sell threshold higher so that only really steep downtrends would trigger a sell.

Yeah, I tweaked the buy/sell thresholds which, coupled with yesterday's moves @ cex = profit Smiley

One uninterrupted 24hr session overnight yielded:

Code:
2014-01-27 12:11:16 (INFO): (PROFIT REPORT) original simulated balance: 0.65978 BTC
2014-01-27 12:11:16 (INFO): (PROFIT REPORT) current simulated balance: 0.69191 BTC
ACTUAL balance: 0.67235958

Simulation mode is currently way optimistic, which is weird: since it doesn't account for mining, it really should be under, not over.

EDIT: someone requested that we output the trades into a CSV file. Is this also something you would use?

YESSSSSSSS. I currently lift CSV data from cex to visualise bot winnings, but raw csv from gekko would be good (IF it kept a constant eye on your balances and had them in the CSV)

Uh oh! Semi-critical error:
Code:
2014-01-26 11:15:30 (ERROR): cancel order failed: Nonce must be incremented
So this error has probably to do with you using the same API keys for both CT and Gekko.

Actually nope, gekko was my only thing running on that api key that day. Plus I've run CT and gekko and my crappy little namecoin selling bot all together before on the one API key and it hasn't given a hoot. Regardless, an increment and retry should fix the hang.

A new observation: when gekko said this, it actually meant "sell", not buy. suggest change to "trade"
Code:
2014-01-27 13:42:26 (INFO): wanted to buy GHS but the amount is to small (0) at cex.io

Edit: and here's today's weirdness:
Code:
2014-01-27 14:32:25 (INFO): wanted to buy but insufficient BTC (17.39210254031083) at cex.io
What. Also that isn't the BTC balance in brackets, it's the GHS equivalent. What? Only happened once on startup. After restarting, it was fine.

I'm interested in all your feedback! Here is my [reflink](https://cex.io/r/0/askmike/0/) btw.

You got it: Feedback: Awesome! Gekko + cex.io = profit.

Lags / bugs out / hangs *far* less often than cryptrade with the localdb, and comes up with a little more than CT in terms of profit.
Gekko candles not having to start at 00sec makes for much agility too. Is it possible to run at sub-minute intervals? I'm scared to try.

After a while (specifically after I've watched charts and made myself understand MACD & PPO) I'll run a second gekko instance with different config... And when I do, your referral link is getting some action. Slap it in your sig too, me talking cex so much in the gekko thread and lauding it for being a reasonably "safe" exchange to test a tradebot in can't hurt your odds of signups.
sr. member
Activity: 287
Merit: 250
Kraken support has been added to the unstable version, we are currently fixing the last remaining kinks out of the cable.

---



Those stats were running CT, with gekko simulating trading with same settings on the side. They approximately agreed, and what you said about gekko's candles not being from 00sec to 60sec explained (some) variance.

Today I've started running just gekko, letting it trade and simulate at the same time. 1m period, Default DEMA & slippage.

so far simulation says:
Code:
2014-01-24 19:05:54 (INFO): (PROFIT REPORT) simulated profit: -0.00385 BTC (-0.62741%)

Which is about right. Hard to measure exactly since I'm currently holding GHS, plus it's been a lame day on the cex curve for dEMA.
(edit: Now I'm back in BTC. Simulated: 0.61022 / Actual: 0.61072 )
(edit again: few hours later Simulated: 0.60987 / Actual: 0.61094 ) increase mostly mining. Trades happened, but variance tiny.

And tiny loss bothers me not a jot, since the bot is there to make sure massive lurches in the graph get acted on quickly. (basically, so I can sleep ever.) I can take a little hit to the balance on flat days that trick EMA slightly, 'cuz the days with movement in the graphs make up for it, and the mined BTC from holding GHS @ cex balances out little hiccup losses. EMA values to 'prefer' holding GHS in flatline and very slow drift situations would be better for cex though to maximise mining.

I'm specifically running sim and real trading at the same time because of the mining from GHS held at cex; sim will show me what I'd have made just trading, whereas actual will in theory be higher due to mining rewards. (edit: knew it.) It's entirely possible at cex that's it's more profitable to sell less often in order to keep mining.

Awesome let me know how it goes. You can always set the sell threshold higher so that only really steep downtrends would trigger a sell.

Now I've seen it run and trade, more output suggestions!
'cos as it is now you can see simulation balances but not your actual balance...
So: after every trade, something like "Bought XX for XX" would help clarify.
And: a portfolio report with % gain/loss much like that of simulated trading would also be good after every trade.
Also: Successful has one L Wink

Thanks will look at this.

EDIT: someone requested that we output the trades into a CSV file. Is this also something you would use?

One more thing: CT ignores amounts below 0.001, (i think) so there was always a bit of balance left in what one doesn't want to be holding. Word on CT's messageboard said that was a cex API limitation. Guess not, cos no such problem with gekko. Nice.
Another difference is that CT will sell mining rewards as they build up, often for unfavourable prices. Because gekko waits until the *beginning* of an EMA upswing, mining reward BTC are sold for GHS at the appropriate time, when they're (relatively) cheap. Double Nice.

Give it a day or two and I'll post how my graph looks after gekko's played with it!

Also: post your cex.io referral link already! Donations are nice but a referral is forever. Plus it's an utter delight having bot-wielding referrals in your cex charts, seeing them rise and fall as their bots trade the EMAs alongside one's own.

I'm interested in all your feedback! Here is my [reflink](https://cex.io/r/0/askmike/0/) btw.

Uh oh! Semi-critical error:

Code:
2014-01-26 11:15:30 (ERROR): cancel order failed: Nonce must be incremented

I've noticed an identical error in cryptrade, so I'm guessing the actual error string is from cex itself, so maybe cex skips the odd nonce.
Difference is: when this happens, cryptrade carries right on regardless, but gekko hangs.
What it (probably) needs is to increment the nonce again and retry.

Also: this happened when there was an order open, which got left hanging.
When gekko started, it interpreted this as
Code:
GHS: -7.12206245
which obviously is weirdass, and makes things like this happen:
Code:
wanted to buy GHS but the amount is to small (-1.0696497) at cex.io
A "cancel / ignore open orders on start" line in the config and a tweak to the startup maths would help such confusion.

Edit: Once the order was cancelled by hand and gekko restarted, it traded it as usual.


So this error has probably to do with you using the same API keys for both CT and Gekko. The nonce has to do with security around the API: in every request applications do to the API they have to send a counter and this counter always needs to be higher than the last one. This is easy if you do all the requests (just write down the last counter everytime and up it by one). Though if you have the same keys for both Gekko and CT they will clash because they are unaware of eachothers counter.

Gekko and CT use the same library to connect to CEX.io, Pulsecat was the author (though he copied it from my Bitstamp code). A fix for this particular issue has been suggested almost 2 weeks ago. Unfortunately pulsecat needs to accept this fix and has not done this yet.

Edit again: having restarted gekko a few times, it's clear that a "get trading sim start balance from real balance" option would help lots.

Great idea Thanks!

looking for help..
i installed node.js
try to follow the installation steps and i get this once i put npm install

------------
C:\Users\Lenovo\Desktop\gekko-master>npm install
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open 'C:\Users\Lenovo\Desktop\gekko-master\package
.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directo
ry.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\Lenovo\Desktop\gekko-master
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path C:\Users\Lenovo\Desktop\gekko-master\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Lenovo\Desktop\gekko-master\npm-debug.log
npm ERR! not ok code 0-

-----------

Could you list the contents of the gekko-master folder on your desktop? (screenshot for example).
newbie
Activity: 59
Merit: 0
looking for help..
i installed node.js
try to follow the installation steps and i get this once i put npm install

------------
C:\Users\Lenovo\Desktop\gekko-master>npm install
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open 'C:\Users\Lenovo\Desktop\gekko-master\package
.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directo
ry.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\Lenovo\Desktop\gekko-master
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path C:\Users\Lenovo\Desktop\gekko-master\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Lenovo\Desktop\gekko-master\npm-debug.log
npm ERR! not ok code 0-

-----------
member
Activity: 112
Merit: 10
Be kind man, don't be mankind
Uh oh! Semi-critical error:

Code:
2014-01-26 11:15:30 (ERROR): cancel order failed: Nonce must be incremented

I've noticed an identical error in cryptrade, so I'm guessing the actual error string is from cex itself, so maybe cex skips the odd nonce.
Difference is: when this happens, cryptrade carries right on regardless, but gekko hangs.
What it (probably) needs is to increment the nonce again and retry.

Also: this happened when there was an order open, which got left hanging.
When gekko started, it interpreted this as
Code:
GHS: -7.12206245
which obviously is weirdass, and makes things like this happen:
Code:
wanted to buy GHS but the amount is to small (-1.0696497) at cex.io
A "cancel / ignore open orders on start" line in the config and a tweak to the startup maths would help such confusion.

Edit: Once the order was cancelled by hand and gekko restarted, it traded it as usual.

Edit again: having restarted gekko a few times, it's clear that a "get trading sim start balance from real balance" option would help lots.
sr. member
Activity: 462
Merit: 253
Most errors you posted came from NPM and I can't really make that more clear.

I actually worked that out, which is why I was trying to use a proxy and connect to NPM directly.

It has been 5+ years since I've had to use command prompt on linux, so I wasn't doing too bad to get that far Wink
member
Activity: 112
Merit: 10
Be kind man, don't be mankind
So you are using the cryptrade for real trading right now? Let me know if the profit reporting is wrong (though note you have to set slippage level yourself, was added a couple of days ago). Though the implementation DEMA is not 100% the same at CT compared to Gekko's version.

Those stats were running CT, with gekko simulating trading with same settings on the side. They approximately agreed, and what you said about gekko's candles not being from 00sec to 60sec explained (some) variance.

Today I've started running just gekko, letting it trade and simulate at the same time. 1m period, Default DEMA & slippage.

so far simulation says:
Code:
2014-01-24 19:05:54 (INFO): (PROFIT REPORT) simulated profit: -0.00385 BTC (-0.62741%)

Which is about right. Hard to measure exactly since I'm currently holding GHS, plus it's been a lame day on the cex curve for dEMA.
(edit: Now I'm back in BTC. Simulated: 0.61022 / Actual: 0.61072 )
(edit again: few hours later Simulated: 0.60987 / Actual: 0.61094 ) increase mostly mining. Trades happened, but variance tiny.

And tiny loss bothers me not a jot, since the bot is there to make sure massive lurches in the graph get acted on quickly. (basically, so I can sleep ever.) I can take a little hit to the balance on flat days that trick EMA slightly, 'cuz the days with movement in the graphs make up for it, and the mined BTC from holding GHS @ cex balances out little hiccup losses. EMA values to 'prefer' holding GHS in flatline and very slow drift situations would be better for cex though to maximise mining.

I'm specifically running sim and real trading at the same time because of the mining from GHS held at cex; sim will show me what I'd have made just trading, whereas actual will in theory be higher due to mining rewards. (edit: knew it.) It's entirely possible at cex that's it's more profitable to sell less often in order to keep mining.

Now I've seen it run and trade, more output suggestions!
'cos as it is now you can see simulation balances but not your actual balance...
So: after every trade, something like "Bought XX for XX" would help clarify.
And: a portfolio report with % gain/loss much like that of simulated trading would also be good after every trade.
Also: Successful has one L Wink

One more thing: CT ignores amounts below 0.001, (i think) so there was always a bit of balance left in what one doesn't want to be holding. Word on CT's messageboard said that was a cex API limitation. Guess not, cos no such problem with gekko. Nice.
Another difference is that CT will sell mining rewards as they build up, often for unfavourable prices. Because gekko waits until the *beginning* of an EMA upswing, mining reward BTC are sold for GHS at the appropriate time, when they're (relatively) cheap. Double Nice.

Give it a day or two and I'll post how my graph looks after gekko's played with it!

Also: post your cex.io referral link already! Donations are nice but a referral is forever. Plus it's an utter delight having bot-wielding referrals in your cex charts, seeing them rise and fall as their bots trade the EMAs alongside one's own.
sr. member
Activity: 287
Merit: 250
anyone actively using this atm with good experiences? gonna try it out soon. Looks great. Was looking into cryptotrader but this bot seems a good alternative and its free Cheesy

I'm using cryptrade which is free and works with the candles stored at cryptotrader (but with no backtesting) at cex.io using the exact same EMA settings gekko uses by default, and that's working out well. 0.55BTC being flipped between GHS and BTC has grown to 0.6 in under a week Cheesy

BUT an instance of gekko doing simulated trading alongside it is (theoretically) making more, athough it's hard to count what with the mining that also occurs @ cex. Now that gekko-localdb can trade, I'll be switching over to it anyminutenow.

Here's about 3 days of gekko simulating trading:

Code:
2014-01-23 21:43:31 (INFO): (PROFIT REPORT) original simulated balance: 0.58611 BTC
2014-01-23 21:43:31 (INFO): (PROFIT REPORT) current simulated balance: 0.62616 BTC
2014-01-23 21:43:31 (INFO): (PROFIT REPORT) simulated profit: 0.04005 BTC (6.83275%)

cryptrade logs differently so the best I got from that is:

Code:
2014-01-23T22:16:17.819Z - verbose: updatePortfolio: { btc: 0.6083721, ghs: 0.00034388 }

and here's 2ish weeks in GHS. Obviously, pay attention only to the peaks. Methinks a little too twitchy.


So you are using the cryptrade for real trading right now? Let me know if the profit reporting is wrong (though note you have to set slippage level yourself, was added a couple of days ago). Though the implementation DEMA is not 100% the same at CT compared to Gekko's version.
sr. member
Activity: 287
Merit: 250
What I failed to mention, is I had Gekko working fine on my Windows PC at home. I wanted to move it to a server for stability, my internet connection is pretty dodgy.

I'll have a look re-migrating across to Ubuntu in a few hours, I appreciate your input Smiley

Awesome, I'm pretty sure we can run it on ubuntu as well. I'm currently running ~25 gekkos across different linux servers (centOS and ubuntu), also running Gekkos on OS X.

Most errors you posted came from NPM and I can't really make that more clear. But I just pushed an update to the localDB branch that will log an error when you try to run Gekko with an old, outdated node version:

I'm actually more curious about your trading rules. I've been tweaking them to see if I can match different tolerance levels to risk. It's pretty experimental in itself, and I'm happy to lose the funds I'm trading with, in the name of art/science/finance.

I'm hoping to get to a point similar to CT where users can design / tweak their own methods. To do that we first need a bunch of indicators (and ta-lib, the library CT plugged in, will remain an optional choice for multiple reasons which means we need to write indicators ourselves).

If you have specific questions about the current DEMA, MACD or PPO implementation and what makes them trigger let me know!
Pages:
Jump to: