print("\t", order, sep="")
class Order:
- def __init__(self, action, amount, rate, base_currency, market):
+ def __init__(self, action, amount, rate, base_currency, market, account="exchange"):
self.action = action
self.amount = amount
self.rate = rate
self.base_currency = base_currency
self.market = market
+ self.account = account
self.result = None
self.status = "pending"
amount = self.amount.value
if debug:
- print("market.create_order('{}', 'limit', '{}', {}, price={})".format(
- symbol, self.action, amount, self.rate))
+ print("market.create_order('{}', 'limit', '{}', {}, price={}, account={})".format(
+ symbol, self.action, amount, self.rate, self.account))
else:
try:
- self.result = self.market.create_order(symbol, 'limit', self.action, amount, price=self.rate)
+ self.result = self.market.create_order(symbol, 'limit', self.action, amount, price=self.rate, account=self.account)
self.status = "open"
except Exception as e:
self.status = "error"
- print("error when running market.create_order('{}', 'limit', '{}', {}, price={})".format(
- symbol, self.action, amount, self.rate))
+ print("error when running market.create_order('{}', 'limit', '{}', {}, price={}, account={})".format(
+ symbol, self.action, amount, self.rate, self.account))
self.error_message = str("{}: {}".format(e.__class__.__name__, e))
print(self.error_message)