diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-08-04 20:12:51 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-08-04 20:12:51 +0200 |
commit | b46ced3defd7bad269c252c9b458b86e2c5e31eb (patch) | |
tree | 999ec8a712c72887befb186c22fbb646149704e4 /market.py | |
parent | f0001495538945af15ae0c28a07e4de4cc18cbf1 (diff) | |
parent | ef8fa5e5454a17c49fe14f6a2c1cffa9cd985bdb (diff) | |
download | Trader-b46ced3defd7bad269c252c9b458b86e2c5e31eb.tar.gz Trader-b46ced3defd7bad269c252c9b458b86e2c5e31eb.tar.zst Trader-b46ced3defd7bad269c252c9b458b86e2c5e31eb.zip |
Merge branch 'dev'v1.10.0
Diffstat (limited to 'market.py')
-rw-r--r-- | market.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -15,6 +15,7 @@ class Market: | |||
15 | report = None | 15 | report = None |
16 | trades = None | 16 | trades = None |
17 | balances = None | 17 | balances = None |
18 | options = None | ||
18 | 19 | ||
19 | def __init__(self, ccxt_instance, args, **kwargs): | 20 | def __init__(self, ccxt_instance, args, **kwargs): |
20 | self.args = args | 21 | self.args = args |
@@ -26,6 +27,7 @@ class Market: | |||
26 | self.balances = BalanceStore(self) | 27 | self.balances = BalanceStore(self) |
27 | self.processor = Processor(self) | 28 | self.processor = Processor(self) |
28 | 29 | ||
30 | self.options = kwargs.get("options", {}) | ||
29 | for key in ["user_id", "market_id"]: | 31 | for key in ["user_id", "market_id"]: |
30 | setattr(self, key, kwargs.get(key, None)) | 32 | setattr(self, key, kwargs.get(key, None)) |
31 | 33 | ||
@@ -466,7 +468,7 @@ class Processor: | |||
466 | 468 | ||
467 | def parse_args(self, action, default_args, kwargs): | 469 | def parse_args(self, action, default_args, kwargs): |
468 | method, allowed_arguments = self.method_arguments(action) | 470 | method, allowed_arguments = self.method_arguments(action) |
469 | args = {k: v for k, v in {**default_args, **kwargs}.items() if k in allowed_arguments } | 471 | args = {k: v for k, v in {**default_args, **kwargs, **self.market.options}.items() if k in allowed_arguments } |
470 | 472 | ||
471 | if "repartition" in args and "base_currency" in args["repartition"]: | 473 | if "repartition" in args and "base_currency" in args["repartition"]: |
472 | r = args["repartition"] | 474 | r = args["repartition"] |