Skip to content

Commit

Permalink
Fixed #86.
Browse files Browse the repository at this point in the history
Handle ApiErrors while trading. This prevents tracebacks on Api-Errors. This
only fixes the symptoms of the underlying defect. But this will be addressed
in other tickets.
  • Loading branch information
toirl committed Aug 29, 2017
1 parent 53cfadb commit abb3d13
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cointrader/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from cointrader.indicators import (
WAIT, BUY, SELL, Signal, signal_map
)
from cointrader.exchanges.poloniex import ApiError
from cointrader.helpers import (
render_bot_statistic, render_bot_tradelog,
render_bot_title, render_signal_detail,
Expand Down Expand Up @@ -424,7 +425,10 @@ def start(self, backtest=False, automatic=False):
automatic = False

if signal:
self._handle_signal(signal)
try:
self._handle_signal(signal)
except ApiError as ex:
log.error("Can not place order: {}".format(ex.message))

if backtest:
if not self._market.continue_backtest():
Expand Down

0 comments on commit abb3d13

Please sign in to comment.