Zenbot: Bitfinex live trading not working

Created on 9 Nov 2017  路  25Comments  路  Source: DeviaVir/zenbot

Hello. I got an issue with live trading on Bitfinex. The bot just cant't perform any action, even manually executed orders won't work. I'm using --debug option and there is no errors, only "WebSockets: We are now fully connected and authenticated." after starting the bot. The price is also not updating.

Some additional info:
-API permissions is alright, i checked them several times. Orders have write permission and everything else is readonly.
-Paper mode and sim works fine.
-Pair is ETH-USD.
-NodeJS version is 8.8.1.

question

All 25 comments

I'm having the same issue. In live trading, it won't make any trades even when manually telling it to buy/sell. I had run it in live with the debug option and received no errors. Making trades on Bitfinex works when using 'zenbot buy/sell'. The pair I tried is LTC-BTC. Though the price is updating fine for me.

No issue with LTC-BTC.
capture
What strategy are you using?

Im using MACD. Not working either with default options or overrided options.

Have you refreshed products.json?

Yes i refreshed it

You should adjust buy_pct to no more than 90%.

This is my current options:

{
    max_sell_loss_pct: '5',
    down_trend_threshold: -0.25,
    up_trend_threshold: 0.25,
    order_adjust_time: 5000,
    debug: true,
    strategy: 'macd',
    sell_stop_pct: 0,
    buy_stop_pct: 0,
    profit_stop_enable_pct: 0,
    profit_stop_pct: 1,
    max_slippage_pct: 5,
    buy_pct: 99,
    sell_pct: 99,
    order_poll_time: 5000,
    markup_pct: 0,
    order_type: 'maker',
    poll_trades: 30000,
    currency_capital: 1000,
    asset_capital: 0,
    rsi_periods: 25,
    avg_slippage_pct: 0.045,
    stats: true,
    mode: 'live',
    selector: 'bitfinex.ETH-USD',
    period: '1h',
    min_periods: 52,
    ema_short_period: 12,
    ema_long_period: 26,
    signal_period: 9,
    overbought_rsi_periods: 25,
    overbought_rsi: 70
}

long period...

But when i use paper mode I can see price updates several times in a minute and can execute sell/buy immediately. Live mode just updates the price once an hour and doesn't do anything :\

Just tried ETH-BTC pair with no luck.

@nedievas I tried LTC-BTC pair and it works fine lol. Checked my products.json for eth/usd:

  {
    "asset": "ETH",
    "currency": "USD",
    "min_size": "0.04",
    "max_size": "5000.0",
    "increment": "0.0001",
    "label": "ETH/USD"
  },

It is your side issue. Sorry ;)

Maybe, but can you give any advice? I'm not the only one with that problem :(

search for different points: maybe it's period, 100% buy...

Having the same issue on Bitfinex. Trades perfectly fine on poloniex though.
bitfinex

Any pair works fine except eth/usd...

refresh products.js by executing update-products.sh. Bitfinex updates minimal orders every week!

Thank you @nedievas trying to do so now but when executing ./update-products.sh I get -bash: ./update-products.sh: Permission denied
Can you please advise?

Thanks

ls -l to check permissions

@nedievas that's what I got:
-rw-rw-r-- 1 myusername myusername 130 Nov 21 19:53 _codemap.js
-rw-rw-r-- 1 myusername myusername 15234 Nov 21 19:53 exchange.js
-rw-rw-r-- 1 myusername myusername 5520 Nov 21 19:53 products.json
-rw-rw-r-- 1 myusername myusername 1037 Nov 21 19:53 update-products.sh

chmod 744 update-products.sh

I refreshed products and tried like 10 different pairs. Only pairs with ETH doesn't work... How could it be my side issue?

I think I found the issue:
syncBalance() in engine.js will not cal the callback if you are in live mode and you have never traded that asset before.

Than, bitfinex will not give you the wallet balance for that asset (see function updateWallet (wallets) {} in exchange.js) The wallets value only has the currencies and assents you have traded before, also if the balance is zero.

The result of that is, that waitForCalc('getBalance', opts, cb) will run forever.

Maybe you can fix that with:

Split up in exchange.js:

else if (
        (ws_walletCalcDone[opts.asset] === false && ws_walletCalcDone[opts.currency] === true) ||
        (ws_walletCalcDone[opts.asset] === true && ws_walletCalcDone[opts.currency] === false)
      ) {
        return waitForCalc('getBalance', opts, cb)
      }

and put in:

else if (ws_walletCalcDone[opts.currency] === true && ws_walletCalcDone[opts.asset] === false) {
   // assume asset has never been traded before
   ws_balance[opts.asset].balance = ws_balance[opts.asset].available = 0
   ws_walletCalcDone[opts.asset] = true
}

.. in getBalance: function (opts, cb) { .. }

Paper mode is not effected because:

    function syncBalance (cb) {
      if (so.mode !== 'live') {
        return cb()
      }
...

I recognize that after I put console.log('wallets:', wallets) into function updateWallet (wallets) { .. } and all by traded assets were in the array, but not the others (and where I have issues with).

Dear issue reporter,

We have slightly changed our github issue policy and would now kindly request folks that have questions that they ask them in our zenbot subreddit.

You can find it here: https://reddit.com/r/zenbot

This issue will be closed, but if you disagree with your ticket being marked as a question feel free to leave a comment defending your case.

Thanks for contributing time and effort!

Greetings,
馃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timstoop picture timstoop  路  4Comments

mrzobot picture mrzobot  路  3Comments

asafyish picture asafyish  路  3Comments

voltz67 picture voltz67  路  5Comments

bbusche picture bbusche  路  5Comments