Pages:
Author

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

full member
Activity: 195
Merit: 100
Hi,

I am new to this bitcoin trading.

I followed https://github.com/askmike/gekko#install and installed the setup in windows 7.

I tried the command node gekko

Below is the result I got on executing it.

2013-10-16 20:54:16 (INFO):     I'm gonna make you rich, Bud Fox.
2013-10-16 20:54:16 (INFO):     Let me show you some Exponential Moving Averages
.


2013-10-16 20:54:16 (INFO):     Using normal settings to monitor the live market

2013-10-16 20:54:17 (INFO):     NOT trading with real money
2013-10-16 20:54:17 (INFO):     Profit reporter active on simulated balance
2013-10-16 20:54:17 (INFO):     Calculating EMA on historical data...

Failed to load historical trades from bitcoincharts


Kindly can you please help me in solving this problem.

Currently I have $100 in my account. Will that be sufficient to start automated live trading with this bot in BTCe?

Only if your willing to lose $100.  This isn't an "out of the box" bot the setting are up to you to work out, I backtested the default setting and got mixed results, over some periods this bot will result in critical failure without a stoploss method implemented so be careful if your putting in everything you've got.

And as far as your problem did you "git pull && npm install" bcuz the bot won't work w/o updated dependencies.

Edit:This error is so unavoidable and common if your install is right you might want to edit the +moment.duration, I set it to one so I can just blitz bitcoincharts till they send me something.
member
Activity: 80
Merit: 10
Hi,

I am new to this bitcoin trading.

I followed https://github.com/askmike/gekko#install and installed the setup in windows 7.

I tried the command node gekko

Below is the result I got on executing it.

2013-10-16 20:54:16 (INFO):     I'm gonna make you rich, Bud Fox.
2013-10-16 20:54:16 (INFO):     Let me show you some Exponential Moving Averages
.


2013-10-16 20:54:16 (INFO):     Using normal settings to monitor the live market

2013-10-16 20:54:17 (INFO):     NOT trading with real money
2013-10-16 20:54:17 (INFO):     Profit reporter active on simulated balance
2013-10-16 20:54:17 (INFO):     Calculating EMA on historical data...

Failed to load historical trades from bitcoincharts


Kindly can you please help me in solving this problem.

Currently I have $100 in my account. Will that be sufficient to start automated live trading with this bot in BTCe?
full member
Activity: 195
Merit: 100
Its really strange but I can get this to work on Ubuntu 12.04 but no Windows 7.

Windows 7 returns bitcoincharts returned an error retrying.

When I was first trying on windows and got this error I thought it was a problem with either bitcoin charts or the program, but the fact that the exact same install returns this error on windows and not ubuntu is mind blowing.  I've tried with the firewall down and everything.

Maybe there's some problem with windows blocking permissions to dependencies?  Or maybe just inbound requests from the program?
sr. member
Activity: 462
Merit: 250
Hi Whydifficult,

Have you given up on this project? Bitstamp has implemented yet another API change.

Regards,
San1ty
MCT
newbie
Activity: 6
Merit: 0

but on bitstamp I still get
Code:
Bitstamp/methods/realtime-candle-fetcher.js:98
    throw 'Failed to load historical trades from ' + this.watcher.name;
                                                   ^
Failed to load historical trades from Bitstamp

yeah as i said, Bitstamp and Bitcoincharts had their api changed. not only the api links changed, also the trades are returned from oldest to newest now. this is why the fillbuckets function doesnt get the expected data and cancels. try to fix it fr bitstamp as well as i did for bitcoincharts or just wait for the author to fix it. i think hes on it and it wont take much time for him.

legendary
Activity: 2955
Merit: 1049
The command you should use is 'node gekko'

not 'node gecko'

Hope that helps.
thx, sorry was a typo
but on bitstamp I still get
Code:
Bitstamp/methods/realtime-candle-fetcher.js:98
    throw 'Failed to load historical trades from ' + this.watcher.name;
                                                   ^
Failed to load historical trades from Bitstamp
sr. member
Activity: 290
Merit: 250
Could you post the full command you tried to run?
only
Code:
node gecko

The command you should use is 'node gekko'

not 'node gecko'

Hope that helps.
legendary
Activity: 2955
Merit: 1049
Could you post the full command you tried to run?
only
Code:
node gecko
sr. member
Activity: 287
Merit: 250
Could you post the full command you tried to run?
legendary
Activity: 2955
Merit: 1049
Code:
module.js:340
    throw err;
          ^
Error: Cannot find module '/home/xx/yy/gekko/gecko'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
sr. member
Activity: 287
Merit: 250
EDIT: Fixed by installing git.

Since the latest version you need git to pull in one of the dependencies, I'll ask the dependency maintainer to update it so this won't be an issue anymore.

Edit: here is the issue I created Smiley
newbie
Activity: 41
Merit: 0
I am back guys.

I fixed the email & underscore errors: pull the latest version and `npm install` to get it working.

(Thanks avert for the email fix suggestion: implemented it the same way. For underscore: they removed a function I was relying on so I am now shifting towards lodash)

I'll check the code fixes posted asap and merge it in. Remember guys: Pull requests are always welcome!


'npm install' errors out on me.

Quote
C:\Users\Mark\Desktop\gekko-master>npm install
npm http GET https://registry.npmjs.org/moment
npm http GET https://registry.npmjs.org/bitcoincharts
npm http GET https://registry.npmjs.org/btc-e
npm http GET https://registry.npmjs.org/mtgox-apiv2
npm http GET https://registry.npmjs.org/prompt-lite
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/line-reader
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/bitstamp/0.0.4
npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

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\Mark\Desktop\gekko-master
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR! code ENOGIT
npm http 304 https://registry.npmjs.org/mtgox-apiv2
npm http 304 https://registry.npmjs.org/bitcoincharts
npm http 304 https://registry.npmjs.org/prompt-lite
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/line-reader
npm http 304 https://registry.npmjs.org/btc-e
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/moment
npm http 304 https://registry.npmjs.org/bitstamp/0.0.4
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Mark\Desktop\gekko-master\npm-debug.log
npm ERR! not ok code 0

EDIT: Fixed by installing git.
sr. member
Activity: 287
Merit: 250
I am back guys.

I fixed the email & underscore errors: pull the latest version and `npm install` to get it working.

(Thanks avert for the email fix suggestion: implemented it the same way. For underscore: they removed a function I was relying on so I am now shifting towards lodash)

I'll check the code fixes posted asap and merge it in. Remember guys: Pull requests are always welcome!
MCT
newbie
Activity: 6
Merit: 0
Well,

I think I got it.

First of all you have to change the source where email.js is retrieved:
/gekko-master/package.json
Code:
"emailjs": "0.3.x",
After this it will successfully install via npm.

Step 1 Change Bitcoincharts Api Link:
/gekko-master/node-modules/bitcoincharts/bitcoincharts.js
Code:
/**
 * The client for bitcoincharts.com API.
 *
 * @constructor
 */
var BitcoinCharts = function() {
  this.url = "http://api.bitcoincharts.com/v1/";
};

Step 2 Change reversal of trades.csv:
/gekko-master/exchanges/bitcoincharts.js
Code:
Watcher.prototype.getTrades = function(since, callback, descending) {
  var params = { symbol: this.symbol };
  if(since)
    // we don't want to hammer bitcoincharts,
    // this will fetch trades between start and now
    params.start = since.format('X');

  var args = _.toArray(arguments);
  this.bitcoinCharts.trades(params, _.bind(function(err, data) {
    if(err)
      return this.retry(this.getTrades, args);

    if(!data || !data.length)
      return this.retry(this.getTrades, args);

    // normalize the data
    var trades = [];
    _.each(data, function(array) {
      trades.push({
        date: array[0],
        price: array[1],
        amount: array[2]
      });
    });

   if(descending)
      callback(trades.reverse());
    else
      callback(trades);

  }, this));
}

Step 3 Change how the latest trades are fetched:
/gekko-master/methods/realtime-candle-fetcher.js
Code:
// this method fetches most recent trades and calculates a new candle based on the trades
CandleCalculator.prototype.getNewCandle = function() {

  if(this.fetchingHistorical)
    // we just fetched all historical buckets
    this.fetchingHistorical = false;
  else
    this.removeOldestBucket();

  this.removeOldestCandle();
  
  log.debug('fetching new trades for new bucket at', this.watcher.name);
  this.watcher.getTrades(util.intervalsAgo(1), this.fillNewBucket, true);
}

Its a quite simple workaround and of course not that beautiful but fetching trades from Bitcoincharts should be fixed then.
But it would be nice if the author or any other trusted programmer could test and validate those changes.

Have a nice weekend gekkos.
MCT
newbie
Activity: 6
Merit: 0
Hi gekko fans!

This program could be awesome. But recently i only get
Code:
Failed to load historical trades from bitcoincharts
.

I already tried to change the api link to the new one http://api.bitcoincharts.com/v1/ but it keeps failing. I spend some hours on debugging via node-inspector and i think it has something to do with the realtime candle fetcher and the following lines:

Code:
// fill buckets based on the trade data.
CandleCalculator.prototype.fillBuckets = function(trades) {
  var latestTradeDate;
  var startBucket = this.currentBucket;

  var emptyBucket = true;
  var nextBucketTime = util.intervalsAgo(this.currentBucket);
  _.every(trades, function(trade) {
    var time = moment.unix(trade.date);
    // as long as this trade is to recent
    // it should go to the next bucket
    while(time > nextBucketTime) {
      if(emptyBucket === true)
        return false;

Actually im neither good in developing nor familiar with javascript.

But i would really appreciate a fix on that.

Please excuse my rather bad english.

newbie
Activity: 22
Merit: 0
in javascript you don't have to write:
if (typeof _.first(bucket) == 'undefined')

you just could write:
if (_.first(bucket))

but this will catch also null values and other falsy values, it can be good thing, it depends.
If want only check for undefinied you can write:
if (_.first(bucket) === undefined)



sr. member
Activity: 267
Merit: 250
I always get
Code:
methods/realtime-candle-fetcher.js:98
    throw 'Failed to load historical trades from ' + this.watcher.name;
                                                   ^
Failed to load historical trades from bitcoincharts
from BTC-e and Bitstamp

Any updates on this?
legendary
Activity: 2955
Merit: 1049
I always get
Code:
methods/realtime-candle-fetcher.js:98
    throw 'Failed to load historical trades from ' + this.watcher.name;
                                                   ^
Failed to load historical trades from bitcoincharts
from BTC-e and Bitstamp
member
Activity: 66
Merit: 10
Added the if statements to the code, and now it seems to be working again. Thanks!

I'll have to wait until the next sell signal to start trading again, though.
sr. member
Activity: 290
Merit: 250
Something odd happened today: I had Gekko running in the background for like a day or so (trading in MtGox), but suddenly I got a signal to sell, even though the chart on bitcoincharts didn't give any indication to do so. When I closed and reopened it, I got things like this:

Code:
2013-09-11 00:18:56 (INFO):     ADVICE is to HOLD @ 129.043 (NaN)

Ran it again with config.debug set:

....



I had the same thing with NaN appearing after the data from MtGox was interrupted, after adding the if statements it appears I'm only missing two candles (20 & 21) when running with debug set to true. Better than waiting until the candles are out of the array as previously stated.



It's now back to calculating the EMA from the available data coming in.
Pages:
Jump to: