Pages:
Author

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

sr. member
Activity: 462
Merit: 253
First lets get Gekko working Smiley

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'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'll have a look re-migrating across to Ubuntu in a few hours, I appreciate your input Smiley
sr. member
Activity: 287
Merit: 250
Great job on the scripting. I just threw $20 into MtGox and started it up, so I could see it work in action.

I'd love to see Cryptsy support, so I can tailor the script to my trading style, and essentially automate what I'm currently doing manually.

You get a gold star from me. Maybe a DogeCoin too Wink

First lets get Gekko working Smiley

I might have missed it through the pages, but is anyone else having issues installing modules from npm?

I just created a new VPS instance, still Ubuntu 12.04.3 x64
[..]
Same error, however it fails at lodash. Is this a NPM server/connection issue?

To bad you are having trouble installing Gekko. The problems all have to do with the fact that the nodejs package shipped with the default ubuntu repos are heavily outdated (nodejs is being really actively updated and Gekko requires a newer version). To install the proper nodejs that won't cause any problems:

Code:
sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

(from the nodejs docs)

--

Note that Gekko is open source and I encourage everyone to give it a try. Though in the current state it's not focused on end users, it requires installing developer tools and a command line / configuration file style interface. I am working on a webbased (hosted) backtesting platform similar to CT as well as hosted real traders (far far future).
newbie
Activity: 2
Merit: 0
I might have missed it through the pages, but is anyone else having issues installing modules from npm?

Ubuntu 12.04.3 here.

Code:
user@bunbury-C08D:~/gekko$ node gekko

[...]

npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
Has anyone else got gekko running on Ubuntu, and found the workaround?


Your node version is too old. You'll have to use 0.10.x

Here is what I currently have:

Code:
root@localhost:~# uname -a
Linux localhost.localdomain 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 16:19:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

root@localhost:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.4 LTS
Release:        12.04
Codename:       precise

root@localhost:~# node -v
v0.10.24

root@localhost:~# npm -v
1.3.21

Here's a tutorial on how to update your nodejs version.
http://slopjong.de/2012/10/31/how-to-install-the-latest-nodejs-in-ubuntu/

Cheers!

sr. member
Activity: 462
Merit: 253
I just created a new VPS instance, still Ubuntu 12.04.3 x64

Just ran the commands:

$ sudo apt-get install nodejs
$ sudo apt-get install git
$ sudo apt-get install npm
$ cd $home
$ git clone git://github.com/askmike/gekko.git
$ cd gekko/
$ npm install

Same error, however it fails at lodash. Is this a NPM server/connection issue?
sr. member
Activity: 462
Merit: 253
I assumed it was a connection issue between me and NPM.

Here is the the result running "npm install"

It fails to get bitcoincharts?

(Node is v0.6.12)

Code:
npm http GET https://registry.npmjs.org/mtgox-apiv2
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/moment
npm http GET https://registry.npmjs.org/btc-e
npm http GET https://registry.npmjs.org/bitcoincharts
npm http GET https://registry.npmjs.org/emailjs/0.3.6
npm http GET https://registry.npmjs.org/cexio
npm http GET https://registry.npmjs.org/prompt-lite
npm http GET https://registry.npmjs.org/bitstamp
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/nedb
npm http GET https://registry.npmjs.org/line-reader

npm ERR! Error: failed to fetch from registry: bitcoincharts
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request. (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest. (/usr/lib/nodejs/request/main.js:412:12)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.onIncoming (http.js:1261:11)
npm ERR!     at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR!     
npm ERR! or use
npm ERR!     reportbug --attach /home/user/gekko/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.8.0-34-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /home/user/gekko
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: bitcoincharts
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/user/gekko/npm-debug.log
npm not ok
sr. member
Activity: 462
Merit: 250
Why aren't you connecting to the default registry?

Also what version of node do you have?:

node -v
sr. member
Activity: 462
Merit: 253
I might have missed it through the pages, but is anyone else having issues installing modules from npm?

Ubuntu 12.04.3 here.

Code:
user@bunbury-C08D:~/gekko$ node gekko

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Cannot find module 'moment'
    at Function._resolveFilename (module.js:332:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object. (/home/user/gekko/gekko.js:20:14)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:32)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
user@bunbury-C08D:~/gekko$
user@bunbury-C08D:~/gekko$ node.js:201
node.js:201: command not found
user@bunbury-C08D:~/gekko$         throw e; // process.nextTick error, or 'error                                                 ' event on first tick
throw: command not found
-bash: //: Is a directory
user@bunbury-C08D:~/gekko$ screen
npm ERR!     reportbug --attach /home/user/gekko/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.8.0-34-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /home/user/gekko
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: lodash
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/user/gekko/npm-debug.log

When I attempt start the gekko.js process on node, I get this:

Code:
user@bunbury-C08D:~/gekko$ node gekko

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Cannot find module 'moment'
    at Function._resolveFilename (module.js:332:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object. (/home/user/gekko/gekko.js:20:14)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:32)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)

So I attempt to install the module in question:

Code:
user@bunbury-C08D:~/gekko$ npm install moment --registry http://165.225.128.50:8000
npm http GET http://165.225.128.50:8000/moment

npm ERR! Error: failed to fetch from registry: moment
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request. (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest. (/usr/lib/nodejs/request/main.js:209:10)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at Socket. (http.js:1137:11)
npm ERR!     at Socket.emit (events.js:67:17)
npm ERR! You may report this log at:
npm ERR!     
npm ERR! or use
npm ERR!     reportbug --attach /home/user/gekko/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.8.0-34-generic
npm ERR! command "node" "/usr/bin/npm" "install" "moment" "--registry" "http://165.225.128.50:8000"
npm ERR! cwd /home/user/gekko
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: moment
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/user/gekko/npm-debug.log
npm not ok

Has anyone else got gekko running on Ubuntu, and found the workaround?
sr. member
Activity: 462
Merit: 253
Great job on the scripting. I just threw $20 into MtGox and started it up, so I could see it work in action.

I'd love to see Cryptsy support, so I can tailor the script to my trading style, and essentially automate what I'm currently doing manually.

You get a gold star from me. Maybe a DogeCoin too Wink
member
Activity: 112
Merit: 10
Be kind man, don't be mankind
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.
hero member
Activity: 602
Merit: 500
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
newbie
Activity: 9
Merit: 0
I don't know if this have suggested before, but I'm sure a lot of people would appreciate it you ware to add a support for the exchanges on cryptsy.com.
Cheers.  Grin
member
Activity: 112
Merit: 10
Be kind man, don't be mankind
new localdb version gitpulled. And very nice it is too. Once cex flatlines again I'll let it trade. One more thought:

Profit reports could be cut to two lines, and would be nice if expressed in currency and asset, with the item you're currently holding in bold/coloured. like so?

2014-01-22 12:12:02 (INFO):   (PROFIT REPORT) original / current simulated balance: 0.58000 BTC / 1.00000 BTC
2014-01-22 12:12:02 (INFO):   (PROFIT REPORT) simulated profit: 1.00000 BTC / 4.00000 GHS (1.00000%)
sr. member
Activity: 287
Merit: 250
The new version (localDB branch) is nearing a stable release. Real trading now works (except Bitstamp, they banned my main IP so will come in an hour or so).

To sum it up:

There is a new version of Gekko which has trading methods for EMA (called DEMA), MACD and PPO on all markets on BTC-e, Mt. Gox, CEX.io. This includes all altcoin markets for BTC-e! So you can now trade LTC and other altcoins with Gekko.

currently enjoying the localdb branch, cos i dig cex.io and gekko is, as far as I know, the only free backtesting game in town for cex since cryptotrader went paid-only. Plus i can actually run gekko in macosX without wrapping it in a VM.

And also the only one where you can verify yourself that nobody tinkered with any data.

Interestingly, I'm still running the cryptrade opensource bot alongside gekko with identical EMA settings, but they're not giving identical advice. In fact, it's barely only similar. But though they differ, gekko hasn't given any bad advice. It's just a bit different to how the cryptrade bot behaves. I'll try the 'traditional' 10/21 and see if they agree then. Hmm.

So I know of a implementation difference: if you set Gekko to use hourly candles it won't start at full hours, but as soon as it got the history it needs (can be at :41 for example). This way the candles / data / triggers can all be off. If you find any other differences let me know.

ANYHOO. I keep gekko open in a terminal, but in the usual procession of
Code:
2014-01-21 00:44:43 (INFO): Processed trades, sleeping for a minute...
messages, it would be nice if every line, the last buy advice was repeated. It's sometimes a marathon of scrolling to see what the last advice was, and it's often scrolled out of buffer.

Those processed trades messages are only logged in debug mode since a couple of days now. Let me know if that helps.

This would be easily visible also if COLO(u)RS got involved, too. Imagine:

2014-01-21 00:44:43 (INFO):   Trading advice: Long - BUY   | Processed trades, sleeping for a minute...
2014-01-21 00:44:43 (INFO):   Trading advice: None - WAIT | Processed trades, sleeping for a minute...
2014-01-21 00:52:34 (INFO):   Trading advice: Short - SELL | Processed trades, sleeping for a minute...

Then even one line would be enough to be advised with a quick glance.

It would also be pretty sweet to have an option to have a verbose line of the current algo. Cryptrade's EMA algo rocks it like this, if enabled:
Code:
2014-01-21T00:55:04.253Z - verbose: EMA difference: 0.01209289 price: 0.05 at Tue Jan 21 2014 01:50:00 GMT+0100 (CET)
A bit of that action would be good for judging those "maybe it's time for human trading intervention" moments.

Good idea, will improve this.

And much as i'm on the localdb branch, so it's not trading for me, it would be most beneficial to be able to easily toggle trading/watching with a keystroke. When a market lurches oddly and you have to jump in to do something, got to be able to disable a bot real quick!

It is auto trading now, read above!

So as a med student with a weak technical background in this script, I am having some trouble configuring everything. Honestly, I am struggling immediately beyond the stage of [node gekko]. Is there somewhere you can point me for further (simple) reading, that'll hopefully clarify the process of getting the trading bot up and running for me?

We have a new version which is almost stable now. This one has way more clear documentation:

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

The new one is almost considered stable (we need to make sure it doesn't make mistakes, etc, which we almost are). You can download that one by running:

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

For both versions it works like this: you edit everything you want in `config.js` and you type `node gekko` to launch it, `ctrl c` to stop it.
newbie
Activity: 3
Merit: 0
So as a med student with a weak technical background in this script, I am having some trouble configuring everything. Honestly, I am struggling immediately beyond the stage of [node gekko]. Is there somewhere you can point me for further (simple) reading, that'll hopefully clarify the process of getting the trading bot up and running for me?
member
Activity: 112
Merit: 10
Be kind man, don't be mankind
currently enjoying the localdb branch, cos i dig cex.io and gekko is, as far as I know, the only free backtesting game in town for cex since cryptotrader went paid-only. Plus i can actually run gekko in macosX without wrapping it in a VM.

Interestingly, I'm still running the cryptrade opensource bot alongside gekko with identical EMA settings, but they're not giving identical advice. In fact, it's barely only similar. But though they differ, gekko hasn't given any bad advice. It's just a bit different to how the cryptrade bot behaves. I'll try the 'traditional' 10/21 and see if they agree then. Hmm.

ANYHOO. I keep gekko open in a terminal, but in the usual procession of
Code:
2014-01-21 00:44:43 (INFO): Processed trades, sleeping for a minute...
messages, it would be nice if every line, the last buy advice was repeated. It's sometimes a marathon of scrolling to see what the last advice was, and it's often scrolled out of buffer.

This would be easily visible also if COLO(u)RS got involved, too. Imagine:

2014-01-21 00:44:43 (INFO):   Trading advice: Long - BUY   | Processed trades, sleeping for a minute...
2014-01-21 00:44:43 (INFO):   Trading advice: None - WAIT | Processed trades, sleeping for a minute...
2014-01-21 00:52:34 (INFO):   Trading advice: Short - SELL | Processed trades, sleeping for a minute...

Then even one line would be enough to be advised with a quick glance.

It would also be pretty sweet to have an option to have a verbose line of the current algo. Cryptrade's EMA algo rocks it like this, if enabled:
Code:
2014-01-21T00:55:04.253Z - verbose: EMA difference: 0.01209289 price: 0.05 at Tue Jan 21 2014 01:50:00 GMT+0100 (CET)
A bit of that action would be good for judging those "maybe it's time for human trading intervention" moments.

And much as i'm on the localdb branch, so it's not trading for me, it would be most beneficial to be able to easily toggle trading/watching with a keystroke. When a market lurches oddly and you have to jump in to do something, got to be able to disable a bot real quick!
sr. member
Activity: 287
Merit: 250

Thanks for the reply!
I didn't get it though, will trailing stop be included along with new stuff or it isn't actually on your to-do list?
I couldn't find it here https://github.com/askmike/gekko/issues/114
In my backtests EMA strategies with a trailing stop outperformed strategies that don't use one by at least 20% in profit.

Is there any estimated time of arrival for a new stable version?


So after stabilizing and verifying this new version and adding the real trader (0.1.0) I'll start working on some things already planned for 0.1.1, a trailing stop is not part of this yet.

Though I have a couple of things planned for after that, these include:

- More indicators (RSI, Ichimoku, Heikin Ashi, trailing stop losses, etc).
- More exchanges (bitfinex, kraken, etc)
- webbased interface

--

I don't have any ETA as this is an open source project unfortunately. Though you can always support the project by adding the algo you want yourself.
newbie
Activity: 28
Merit: 0

2. At this moment not, the version you are looking at only support the method EMA as described here. We are working on a new (but not yet stable) version of Gekko which currently supports DEMA, MACD and PPO and we are trying to include more asap.


Thanks for the reply!
I didn't get it though, will trailing stop be included along with new stuff or it isn't actually on your to-do list?
I couldn't find it here https://github.com/askmike/gekko/issues/114
In my backtests EMA strategies with a trailing stop outperformed strategies that don't use one by at least 20% in profit.

Is there any estimated time of arrival for a new stable version?
sr. member
Activity: 287
Merit: 250
whydifficult, thanks for sharing your bot!
I was desperatly trying to backtest my EA on btc-e's MT4, but I fail due to strategy tester wrong commission calculation on every data older then 24 november 2013.
So, right now I am looking towards using your bot and I have several question I hope someone will answer

1) does Gekko counts broker commission while backtesting?

2) does it have any kind of a trailing stop?

3) in all the programming world I am slightly familiar with C++, nothing more, how long will it take me to implement those features listed above in the Gekko bot if they are not already on board? (of course I am not seeking for a precise answer, just an estimation like - a day, a week, several months?)

1. Gekko connects straights to exchanges, no brokers involved. Though exchanges also charge fees (which most of the time depends on the amount of volume). The backtest simulates buying / selling directly at the exchange. With Gekko you can configure this fee and the backtester will take it into account, the default is 0.6% (the default fee on mt. gox).

2. At this moment not, the version you are looking at only support the method EMA as described here. We are working on a new (but not yet stable) version of Gekko which currently supports DEMA, MACD and PPO and we are trying to include more asap.

Gekko saved my life, thanks again for sharing. Amazing new developments, and great suggestions to include Kraken (really the most professional exchange so far) and Bitfinex too Smiley

EDIT: Now I got many errors and warnings when installing Gekko on one laptop (after several entirely unsuccessful attempts) but after this most recent attempt it seems like it successfully installed, and it started calculating EMA on historical data. Regardless of that, should I try again until it's a totally clean install? I'm new to almost any type of coding, please help!

Awesome thanks!


--

I have spawned a mini chart website where you can watch the following markets in semi realtime (updates automatically about every minute):

- bitstamp-USD-BTC
- mtgox-USD-BTC
- cexio-BTC-GHS
- btce-USD-BTC
- btce-USD-LTC
- btce-BTC-LTC
- btce-RUR-BTC
- btce-BTC-NVC

data.wizb.it.

All the data is delivered by 8 gekkos (of the new version) running in parallel across all those markets.
newbie
Activity: 41
Merit: 0
Gekko saved my life, thanks again for sharing. Amazing new developments, and great suggestions to include Kraken (really the most professional exchange so far) and Bitfinex too Smiley

EDIT: Now I got many errors and warnings when installing Gekko on one laptop (after several entirely unsuccessful attempts) but after this most recent attempt it seems like it successfully installed, and it started calculating EMA on historical data. Regardless of that, should I try again until it's a totally clean install? I'm new to almost any type of coding, please help!
newbie
Activity: 28
Merit: 0
whydifficult, thanks for sharing your bot!
I was desperatly trying to backtest my EA on btc-e's MT4, but I fail due to strategy tester wrong commission calculation on every data older then 24 november 2013.
So, right now I am looking towards using your bot and I have several question I hope someone will answer

1) does Gekko counts broker commission while backtesting?

2) does it have any kind of a trailing stop?

3) in all the programming world I am slightly familiar with C++, nothing more, how long will it take me to implement those features listed above in the Gekko bot if they are not already on board? (of course I am not seeking for a precise answer, just an estimation like - a day, a week, several months?)
Pages:
Jump to: