mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Update to do Builtin Precise math
This commit is contained in:
parent
a793cf8f05
commit
c8e0fc926d
|
@ -707,9 +707,9 @@ class Exchange:
|
|||
if self.precisionMode == TICK_SIZE:
|
||||
precision = Precise(str(self.markets[pair]['precision']['price']))
|
||||
price_str = Precise(str(price))
|
||||
missing = price_str.mod(precision)
|
||||
if not missing.equals(Precise("0")):
|
||||
price = round(float(str(price_str.sub(missing).add(precision))), 14)
|
||||
missing = price_str % precision
|
||||
if not missing == Precise("0"):
|
||||
price = round(float(str(price_str - missing + precision)), 14)
|
||||
else:
|
||||
symbol_prec = self.markets[pair]['precision']['price']
|
||||
big_price = price * pow(10, symbol_prec)
|
||||
|
|
Loading…
Reference in New Issue
Block a user