Bitcoin Forum
May 08, 2024, 08:37:31 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Trading Discussion / Re: tAPI-bot - Automated crossover trade platform for BTC-e on: October 02, 2013, 10:48:31 AM
Anyone else has problems with placing orders on btc_usd?

Sometimes it just does nothing when it says market trending up and sometimes it says not enough usd.
2  Economy / Trading Discussion / Re: Gekko - a javascript trading bot for nodejs on: September 30, 2013, 08:24:58 PM

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.

3  Economy / Trading Discussion / Re: Gekko - a javascript trading bot for nodejs on: September 27, 2013, 05:56:45 PM
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.
4  Economy / Trading Discussion / Re: tAPI-bot - Automated crossover trade platform for BTC-e on: September 26, 2013, 05:13:51 PM
Nice piece of code BUT you really have to fetch candles via bitcoincharts api. The last 150 trades are just a too small timeframe to build MAs on. I tried several options but only loosing money due to wrong signals.

Please consider at least to download the last ~100 hours of tradedata from the bitcoincharts api and calculate hourly close prices.

Then we could use crossing averages strategies on those pseudocandles.


5  Economy / Trading Discussion / Re: Gekko - a javascript trading bot for nodejs on: September 26, 2013, 05:01:51 PM
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.

6  Other / Beginners & Help / Gekko Bot Bitcoincharts Issue on: September 23, 2013, 06:39:36 PM
Hi there!!

Im sorry for me bad english but ill try as good as as i can.

There is an issue with the gekko bot due to recent  changes at the bitcoincharts api.

First the link to the api has changed but there has to be some more changes of the data provided by the api.

Maybe someone of you can solve this issue? I think the invalid code is in the realtime candle fetcher

The gekko source code is downloadable at github:
https://github.com/askmike/gekko

For those of you who dont know this really nice bot:

It has great backtesting features and can also perform live trading on gox, btc-e and bitstamp with crossing EMAs.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!