Permalink
Browse files

Additional info.

  • Loading branch information...
1 parent 0a0647a commit 23f92e6f2c48f71aab6c0efe34d3fdbeed250ab5 @rokj committed Mar 18, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 scripts/dealing.py
View
@@ -233,16 +233,21 @@ def check_status(trades, orders):
trade.total_price = exchanges[trade.exchange.name].order.sum_price
trade.total_amount = exchanges[trade.exchange.name].order.sum_amount
if (trade.status == "bought" or trade.status == "sold"):
+ if (settings.bd_debug == True):
+ console_log("trade %s at price %s, amount %s and currency %s completed" % (trade.pk, trade.price, trade.amount, trade.currency.abbreviation))
trade.completed = True
trade.save()
elif isinstance(exchanges[trade.exchange.name].order, dict):
if "error" in exchanges[trade.exchange.name].order:
trade.completed = True
trade.save()
- trade_log = TradeLog(created_by=trade.user, trade=trade, log="custom", log_desc="Error for trade %s with message from exchange %s." % (trade.pk, exchanges[trade.exchange.name].order["error"]))
+ trade_log = TradeLog(created_by=trade.user, trade=trade, log="custom", log_desc="Error for trade %s with message %s from exchange." % (trade.pk, exchanges[trade.exchange.name].order["error"]))
trade_log.save()
+ if (settings.bg_debug == True):
+ console_log("trade %s at price %s, amount %s and currency %s completed with error on getting transactions from exchange. Message was %s." % (trade.pk, trade.price, trade.amount, trade.currency.abbreviation, exchanges[trade.exchange.name].order["error"]))
+
while True:
time.sleep(settings.check_interval)
try:

0 comments on commit 23f92e6

Please sign in to comment.