Add price_get_one_pip filter

This commit is contained in:
Matthias
2020-04-15 07:19:27 +02:00
parent c8ccdbcb9a
commit 36e714a7b2
2 changed files with 13 additions and 3 deletions

View File

@@ -452,6 +452,17 @@ class Exchange:
price = ceil(big_price) / pow(10, symbol_prec)
return price
def price_get_one_pip(self, pair: str, price: float) -> float:
"""
Get's the "1 pip" value for this pair.
Used in PriceFilter to calculate the 1pip movements.
"""
precision = self.markets[pair]['precision']['price']
if self.precisionMode == TICK_SIZE:
return price % precision
else:
return 1 / pow(10, precision)
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)}'