aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--portfolio.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/portfolio.py b/portfolio.py
index acb61b2..946a96a 100644
--- a/portfolio.py
+++ b/portfolio.py
@@ -4,8 +4,6 @@ from decimal import Decimal as D
4# Put your poloniex api key in market.py 4# Put your poloniex api key in market.py
5from market import market 5from market import market
6 6
7debug = False
8
9class Portfolio: 7class Portfolio:
10 URL = "https://cryptoportfolio.io/wp-content/uploads/portfolio/json/cryptoportfolio.json" 8 URL = "https://cryptoportfolio.io/wp-content/uploads/portfolio/json/cryptoportfolio.json"
11 liquidities = {} 9 liquidities = {}
@@ -408,7 +406,6 @@ class Trade:
408 self.action) 406 self.action)
409 407
410class Order: 408class Order:
411 DEBUG = debug
412 409
413 def __init__(self, action, amount, rate, base_currency, market): 410 def __init__(self, action, amount, rate, base_currency, market):
414 self.action = action 411 self.action = action
@@ -436,11 +433,11 @@ class Order:
436 def finished(self): 433 def finished(self):
437 return self.status == "closed" or self.status == "canceled" 434 return self.status == "closed" or self.status == "canceled"
438 435
439 def run(self): 436 def run(self, debug=False):
440 symbol = "{}/{}".format(self.amount.currency, self.base_currency) 437 symbol = "{}/{}".format(self.amount.currency, self.base_currency)
441 amount = self.amount.value 438 amount = self.amount.value
442 439
443 if self.DEBUG: 440 if debug:
444 print("market.create_order('{}', 'limit', '{}', {}, price={})".format( 441 print("market.create_order('{}', 'limit', '{}', {}, price={})".format(
445 symbol, self.action, amount, self.rate)) 442 symbol, self.action, amount, self.rate))
446 else: 443 else: