Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

[mtgox] Server responded with an error or no data, sleeping. #3

Closed
ghost opened this issue May 26, 2013 · 11 comments
Closed

[mtgox] Server responded with an error or no data, sleeping. #3

ghost opened this issue May 26, 2013 · 11 comments

Comments

@ghost
Copy link

ghost commented May 26, 2013

Hi,

  • I have the latest version (last pull around 1 day ago ~25.05.2013)
  • My mtgox account is setup to trade with EUR. (your mtgox config doesnt seem to have a currency switch like btce)
  • API Key has "Get Info" and "Trade" Permissions
  • I enabled real trading for mtgox and received the following error

2013-05-26 13:49:49 (INFO): ADVICE is to BUY @ 133.590 (0.379)
2013-05-26 13:49:49 (INFO): (PROFIT REPORT) -0.000% profit (in 1 trades)
2013-05-26 13:49:49 (ERROR): Server responded with an error or no data, sleeping.
2013-05-26 13:50:49 (DEBUG): fetching exchange...
2013-05-26 13:50:53 (DEBUG): fetched exchange
2013-05-26 13:50:53 (DEBUG): calculated new tick: -1 price: 133.590 diff: 0.427
2013-05-26 13:50:53 (ERROR): Server responded with an error or no data, sleeping.
2013-05-26 13:51:53 (DEBUG): fetching exchange...
2013-05-26 13:51:53 (ERROR): Server responded with an error or no data, sleeping.
2013-05-26 13:52:53 (DEBUG): fetching exchange...
2013-05-26 13:52:54 (ERROR): Server responded with an error or no data, sleeping.

My config is as follows:

var config = {};

config.tradingMethod =  'Exponential Moving Averages';
config.watch =  {
  exchange: 'MtGox',
}
config.EMA = {
  interval: 60,
  shortEMA: 10,
  longEMA: 21,
  ticks: 100,
  sampleSize: 10,
  sellTreshold: -0.25,
  buyTreshold: 0.25
};
config.traders = [
  {
    exchange: 'MtGox',
    key: 'my_key_is_here',
    secret: 'my_secret_is_here',
    enabled: true
  },
  {
    exchange: 'BTCe',
    key: '',
    secret: '',
    currency: 'USD',
    enabled: false
  },
  {
    exchange: 'Bitstamp',
    user: '',
    password: '',
    enabled: false
  }
];
config.profitCalculator = {
  enabled: true,
  reportInBTC: false,
  simulationBalance: {
    btc: 1,
    foreign: 100,
  }
}
config.mail = {
  enabled: false,
  email: '', 
  password: ''
}
config.debug = true;
module.exports = config;

Any idea what could be wrong?

@askmike
Copy link
Owner

askmike commented May 26, 2013

There is no currency switch for MtGox yet because the current version of the 'node-mtgox-apiv2' dependency has USD hardcoded. I submitted a patch, but it still needs to get updated on npm before I can include it in Gekko.

It appears that you can only trade from/to the default currency set in Mt. Gox. I've run into the same issue myself on the first version of Gekko and I changed it to USD on Mt. Gox to resolve it (you can always try to let Gekko make profit on USD and revert back to EUR when you are done).

There is currently a bug in Gekko's error handling: when the buy/sell order errors like this it will get passed to wrong place and Gekko will try to refetch trades instead of redo the order. I'm working on a improved buy / sell script that solves this.

@siergiej
Copy link

Ok, so how do we do it? I've changed the default currency in mtgox account settings to USD, and I'm still getting the same error

@ghost
Copy link
Author

ghost commented May 26, 2013

@siergiej The problem is probably that you do not have any USD, if you have just switched to USD in mtgox account.

The error remains the same. Dunno if it is because it doesnt have any USD to use to buy BTC or if it is something else.

@ghost
Copy link
Author

ghost commented May 26, 2013

@askmike Could you please keep us informed about when the patch is updated and how to update gekko afterwards.

@siergiej
Copy link

So i did a simple test - sold 0.01BTC for USD. Now I've got $1.3 in my accound, and Gekko still displays errors

@askmike
Copy link
Owner

askmike commented May 26, 2013

@siergiej @LockDoc there was a bug in Gekko since yesterday but I just pushed a fix for it. Could you please pull and try again?

If you want to just test if Gekko will sell/buy you can add the code below rule 77 in gekko.js:

setTimeout(function() {
  trader.trade('BUY'); // if it bought change BUY to SELL and try again
}, 5000);

and comment out everything behind mail advice (at the end of the file).

Debugging code aroung Mt. Gox calls is pretty hard because the API wrapper (external dependency) swallows all errors, even the ones in my code.

@siergiej
Copy link

Looks like it works fine now. Thanks!

@ghost
Copy link
Author

ghost commented May 27, 2013

@askmike Thanks for the effort so far.
By reading this: ameensol/node-mtgox-apiv2#9
The patch should be included in mtgox api by now.
Is gekko now able to deal with EUR?

@askmike
Copy link
Owner

askmike commented May 27, 2013

Yes the dependecy is updated now, however I need to change some minor things in Gekko and test all the currencies that Gekko will support.

For example not every currency is returned with the same amount of decimals and I want to know for sure this won't be an issue. I hope I will find some time later today to do this.

@askmike
Copy link
Owner

askmike commented May 28, 2013

I've just pushed an update: you can now set the currency of Mt Gox trading!

All information can be found in the Configuring Gekko doc.

Gekko is unable to trade due to bug in dependency

Important Note: There is currently a bug in the dependency for Mt. Gox. Gekko currently cannot trade at Mt. Gox until:

You have to apply the patch yourself (add 1 slash on rule 113) or wait until the maintainer merges the patch.

@askmike askmike closed this as completed May 28, 2013
@askmike
Copy link
Owner

askmike commented May 30, 2013

I've added the first version of the portfolioManager. I did over 20 real trades to test it ( yes it did cost me some fee :( ), it does need more proper testing.

9e0ade0

Note that bitcoincharts currently is returning 502 all the time and there is a new bug in the Mt. Gox dependency. Gekko can't fetch trade data until you patch it manually or it gets patched and updated upstream.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants