Round amount to precision also for dry-runs
This commit is contained in:
@@ -379,15 +379,16 @@ class Exchange:
|
||||
def dry_run_order(self, pair: str, ordertype: str, side: str, amount: float,
|
||||
rate: float, params: Dict = {}) -> Dict[str, Any]:
|
||||
order_id = f'dry_run_{side}_{randint(0, 10**6)}'
|
||||
_amount = self.symbol_amount_prec(pair, amount)
|
||||
dry_order = {
|
||||
"id": order_id,
|
||||
'pair': pair,
|
||||
'price': rate,
|
||||
'amount': amount,
|
||||
"cost": amount * rate,
|
||||
'amount': _amount,
|
||||
"cost": _amount * rate,
|
||||
'type': ordertype,
|
||||
'side': side,
|
||||
'remaining': amount,
|
||||
'remaining': _amount,
|
||||
'datetime': arrow.utcnow().isoformat(),
|
||||
'status': "closed" if ordertype == "market" else "open",
|
||||
'fee': None,
|
||||
|
Reference in New Issue
Block a user