Skip to content
This repository
Browse code

Additional info.

  • Loading branch information...
commit 23f92e6f2c48f71aab6c0efe34d3fdbeed250ab5 1 parent 0a0647a
Rok Jaklič authored March 18, 2012

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. 7  scripts/dealing.py
7  scripts/dealing.py
@@ -233,6 +233,8 @@ def check_status(trades, orders):
233 233
                 trade.total_price = exchanges[trade.exchange.name].order.sum_price
234 234
                 trade.total_amount = exchanges[trade.exchange.name].order.sum_amount
235 235
                 if (trade.status == "bought" or trade.status == "sold"):
  236
+                    if (settings.bd_debug == True):
  237
+                        console_log("trade %s at price %s, amount %s and currency %s completed" % (trade.pk, trade.price, trade.amount, trade.currency.abbreviation))
236 238
                     trade.completed = True
237 239
                 trade.save()
238 240
             elif isinstance(exchanges[trade.exchange.name].order, dict):
@@ -240,9 +242,12 @@ def check_status(trades, orders):
240 242
                     trade.completed = True
241 243
                     trade.save()
242 244
 
243  
-                    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"]))
  245
+                    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"]))
244 246
                     trade_log.save()
245 247
 
  248
+                    if (settings.bg_debug == True):
  249
+        	            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"]))
  250
+
246 251
 while True:
247 252
     time.sleep(settings.check_interval)
248 253
     try:

0 notes on commit 23f92e6

Please sign in to comment.
Something went wrong with that request. Please try again.