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

Balance broken with bitfinex (not enough...) #542

Closed
DarkShimy00 opened this issue Sep 12, 2017 · 7 comments
Closed

Balance broken with bitfinex (not enough...) #542

DarkShimy00 opened this issue Sep 12, 2017 · 7 comments
Labels

Comments

@DarkShimy00
Copy link

Hi,

I've been running the bot for 2 weeks on bitfinex but it did not make any trade. Upon closer inspection, it appears that the bot fails to buy/sell.

I tried to debug it by placing a sell order for a small amount of ETH (0.1+ ETH in the exchange wallet) but it failed:

~/zenbot# zenbot sell bitfinex.ETH-USD --pct=5 --debug

WebSockets: We are now fully connected and authenticated.
placing order...
placing order...
not enough asset balance to sell!

It seems to be the same issue as #123 but with Zenbot 4.

Thanks,

@nedievas
Copy link
Contributor

Hello. By taking a glimpse to your command, I see no amount specified. Look directly to Bitfinex site for message on execution. Another point, what is your configuration?

@DarkShimy00
Copy link
Author

Good point, using zenbot sell bitfinex.ETH-USD --size 0.01 the order is correctly placed. Isn't the --pct option supposed to sell x percents of the current balance?

On another note, I can't get the bot to trade (similar to #516) using the default config file (just filled in the bitfinex key and secret) and the command zenbot trade bitfinex.ETH-USD --strategy=macd --period=1h --profit_stop_enable_pct=8 --profit_stop_pct=4 --sell_rate=-0.006 --debug.

@nedievas
Copy link
Contributor

WTF is --sell_rate?

Here are options for sell:

[nedievas@nedievas zenbot]$ zenbot sell --help

  Usage: sell [options] [selector]

  execute a sell order to the exchange


  Options:

    --pct <pct>               sell with this % of currency balance
    --order_type <type>       order type to use (maker/taker)
    --size <size>             sell specific size of currency
    --markup_pct <pct>        % to mark up ask price
    --order_adjust_time <ms>  adjust ask on this interval to keep order competitive
    --max_slippage_pct <pct>  avoid selling at a slippage pct above this float
    --debug                   output detailed debug info
    -h, --help                output usage information

and here are options for trade:

[nedievas@nedievas zenbot]$ zenbot trade --help

  Usage: trade [options] [selector]

  run trading bot against live market data

  Options:

    --conf <path>                   path to optional conf overrides file
    --strategy <name>               strategy to use
    --order_type <type>             order type to use (maker/taker)
    --paper                         use paper trading mode (no real trades will take place)
    --manual                        watch price and account balance, but do not perform trades automatically
    --non_interactive               disable keyboard inputs to the bot
    --currency_capital <amount>     for paper trading, amount of start capital in currency
    --asset_capital <amount>        for paper trading, amount of start capital in asset
    --avg_slippage_pct <pct>        avg. amount of slippage to apply to paper trades
    --buy_pct <pct>                 buy with this % of currency balance
    --sell_pct <pct>                sell with this % of asset balance
    --markup_pct <pct>              % to mark up or down ask/bid price
    --order_adjust_time <ms>        adjust bid/ask on this interval to keep orders competitive
    --order_poll_time <ms>          poll order status on this interval
    --sell_stop_pct <pct>           sell if price drops below this % of bought price
    --buy_stop_pct <pct>            buy if price surges above this % of sold price
    --profit_stop_enable_pct <pct>  enable trailing sell stop when reaching this % profit
    --profit_stop_pct <pct>         maintain a trailing stop this % below the high-water mark of profit
    --max_sell_loss_pct <pct>       avoid selling at a loss pct under this float
    --max_slippage_pct <pct>        avoid selling at a slippage pct above this float
    --rsi_periods <periods>         number of periods to calculate RSI at
    --poll_trades <ms>              poll new trades at this interval in ms
    --disable_stats                 disable printing order stats
    --reset_profit                  start new profit calculation from 0
    --debug                         output detailed debug info
    -h, --help                      output usage information

and for macd strategy:

  description:
    Buy when (MACD - Signal > 0) and sell when (MACD - Signal < 0).
  options:
    --period=<value>  period length (default: 1h)
    --min_periods=<value>  min. number of history periods (default: 52)
    --ema_short_period=<value>  number of periods for the shorter EMA (default: 12)
    --ema_long_period=<value>  number of periods for the longer EMA (default: 26)
    --signal_period=<value>  number of periods for the signal EMA (default: 9)
    --up_trend_threshold=<value>  threshold to trigger a buy signal (default: 0)
    --down_trend_threshold=<value>  threshold to trigger a sold signal (default: 0)
    --overbought_rsi_periods=<value>  number of periods for overbought RSI (default: 25)
    --overbought_rsi=<value>  sold when RSI exceeds this value (default: 70)

@DarkShimy00
Copy link
Author

Looks like the example need an update then.

Still, I don't understand why trade doesn't work while sim works fine with these options.

@KryptoNova
Copy link
Contributor

@DarkShimy00 where you selling at a 100% buy_pct with Zenbot in live mode? If so, perhaps you did not have enough currency to cover the fee. I think that the change that was done in #711 may benefit if this was the case.

Even though it was something I was running into on Bittrex, theoretically it could have been happening in lots of different exchanges that do not auto adjust the asset level to allow for the fee to be deducted.

@DeviaVir
Copy link
Owner

Closing due to inactivity

@DJCrashdummy
Copy link
Contributor

@nedievas have you figured out what --sell_rate=<value> is?
i'm asking, because i also stumbled across this option while reworking the docs and trying to explain the example and output (#1816 (comment)).

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

No branches or pull requests

5 participants