aboutsummaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-01-26 00:10:03 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-01-26 00:13:23 +0100
commitecba11139e357567c46f7ba2a0cf8dbd98266fe8 (patch)
treed75d352988833038c3243f1e3e961434ded1bdc6 /test.py
parent66c8b3dd07f4e45be2242d06f8f357adefeb2a4c (diff)
downloadTrader-ecba11139e357567c46f7ba2a0cf8dbd98266fe8.tar.gz
Trader-ecba11139e357567c46f7ba2a0cf8dbd98266fe8.tar.zst
Trader-ecba11139e357567c46f7ba2a0cf8dbd98266fe8.zip
Add first steps for margin trading
Diffstat (limited to 'test.py')
-rw-r--r--test.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/test.py b/test.py
index b747617..8a6ba50 100644
--- a/test.py
+++ b/test.py
@@ -676,7 +676,7 @@ class AcceptanceTest(unittest.TestCase):
676 self.assertEqual(D("0.00003003"), all_orders[1].rate) 676 self.assertEqual(D("0.00003003"), all_orders[1].rate)
677 677
678 678
679 def create_order(symbol, type, action, amount, price=None): 679 def create_order(symbol, type, action, amount, price=None, account="exchange"):
680 self.assertEqual("limit", type) 680 self.assertEqual("limit", type)
681 if symbol == "ETH/BTC": 681 if symbol == "ETH/BTC":
682 self.assertEqual("sell", action) 682 self.assertEqual("sell", action)
@@ -771,7 +771,6 @@ class AcceptanceTest(unittest.TestCase):
771 # Action 6 771 # Action 6
772 portfolio.Trade.prepare_orders(only="buy", compute_value=lambda x, y: x["ask"]) 772 portfolio.Trade.prepare_orders(only="buy", compute_value=lambda x, y: x["ask"])
773 773
774
775 all_orders = portfolio.Trade.all_orders(state="pending") 774 all_orders = portfolio.Trade.all_orders(state="pending")
776 self.assertEqual(3, len(all_orders)) 775 self.assertEqual(3, len(all_orders))
777 self.assertEqual(portfolio.Amount("ETC", D("38.5")/3), all_orders[0].amount) 776 self.assertEqual(portfolio.Amount("ETC", D("38.5")/3), all_orders[0].amount)