miro-ka / mosquito

Trading Bot with focus on Evolutionary Algorithms and Machine Learning
GNU General Public License v3.0
261 stars 53 forks source link

Live-Trading: ValueError #32

Closed crack00r closed 7 years ago

crack00r commented 7 years ago
root@j314793:~/mosquito# python3 mosquito.py --live
Starting simulation..
dataset_cnt: 1
live_trading
Wed Aug  2 09:22:14 2017, close:0.000005, | 0.00277929USDT| 0.12689BTC | $: 0.0%, b&h: 0.0%
going to sleep for:  45  seconds.
dataset_cnt: 2
live_trading
Wed Aug  2 09:23:15 2017, close:0.000005, | 0.00277929USDT| 0.12689BTC | $: 0.0%, b&h: 0.0%
going to sleep for:  44  seconds.
dataset_cnt: 3
live_trading
Wed Aug  2 09:24:14 2017, close:0.000005, | 0.00277929USDT| 0.12689BTC | $: 0.0%, b&h: 0.0%
going to sleep for:  45  seconds.
dataset_cnt: 4
live_trading
Wed Aug  2 09:25:14 2017, close:0.000005, | 0.00277929USDT| 0.12689BTC | $: 0.0%, b&h: 0.0%
going to sleep for:  46  seconds.
dataset_cnt: 5
live_trading
Wed Aug  2 09:26:14 2017, close:0.000005, | 0.00277929USDT| 0.12689BTC | $: 0.0%, b&h: 0.0%
going to sleep for:  45  seconds.
dataset_cnt: 6
live_trading
Traceback (most recent call last):
  File "mosquito.py", line 35, in <module>
    main(args)
  File "mosquito.py", line 9, in main
    engine.run()
  File "/root/mosquito/core/engine.py", line 163, in run
    self.trades)
  File "/root/mosquito/core/bots/live.py", line 57, in trade
    return self.exchange.trade(actions, wallet, TradeMode.live)
  File "/root/mosquito/exchanges/exchange.py", line 67, in trade
    return self.exchange.trade(actions, wallet, trade_mode)
  File "/root/mosquito/exchanges/poloniex/polo.py", line 86, in trade
    actions = self.life_trade(actions)
  File "/root/mosquito/exchanges/poloniex/polo.py", line 103, in life_trade
    action.amount = self.get_buy_sell_all_amount(wallet, action.action, action.pair, action.rate)
  File "/root/mosquito/exchanges/poloniex/polo.py", line 147, in get_buy_sell_all_amount
    if rate == 0.0:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
root@j314793:~/mosquito#
miro-ka commented 7 years ago

Please, are you using your own or customized strategy? It seems that the 'action.rate' passed to the exchange is an array, and should be single value.

I have added some more debug info to see more (please use verbose = 2 in your config.ini). Please switch to develop branch.

PLEASE, BE VERY CAREFUL WITH LIVE TRADING - we are still in beta! The exchange code should work fine, but the strategies are not mature/tested well yet.

crack00r commented 7 years ago

no, i just use mosquito.py without special strategy, it use your default

its just my 2nd acc. with a bit playmoney

miro-ka commented 7 years ago

ok thanks, I will take a look at it

crack00r commented 7 years ago

Image

crack00r commented 7 years ago

https://nopaste.me/view/c16d9c46

crack00r commented 7 years ago

maybe add a failsave, becourse, polo api is sometimes rly slow, ore buggy and didnt answer

miro-ka commented 7 years ago

Added exception handling + more order info.