Changesets · Branches · Tags · Compare
| Changeset | a8d373509c08eec90d3ae3b6ac1c8eb79c2f14f138ae0c2cbddb8ae92d80da75 |
|---|---|
| Author | Matthias <xmatthias@outlook.com> · 2021-04-10 13:50 +02:00 |
| Committer | Matthias <xmatthias@outlook.com> · 2021-04-10 13:50 +02:00 |
| Parents | 9c160a67c0ef |
5 files changed
modified freqtrade/exchange/binance.py +1 −1
| @@ -52,7 +52,7 @@ | ||
| 52 | 52 | 'In stoploss limit order, stop price should be more than limit price') |
| 53 | 53 | |
| 54 | 54 | if self._config['dry_run']: |
| 55 | - dry_order = self.dry_run_order( | |
| 55 | + dry_order = self.create_dry_run_order( | |
| 56 | 56 | pair, ordertype, "sell", amount, stop_price) |
| 57 | 57 | return dry_order |
| 58 | 58 |
modified freqtrade/exchange/exchange.py +4 −4
| @@ -543,8 +543,8 @@ | ||
| 543 | 543 | # See also #2575 at github. |
| 544 | 544 | return max(min_stake_amounts) * amount_reserve_percent |
| 545 | 545 | |
| 546 | - def dry_run_order(self, pair: str, ordertype: str, side: str, amount: float, | |
| 547 | - rate: float, params: Dict = {}) -> Dict[str, Any]: | |
| 546 | + def create_dry_run_order(self, pair: str, ordertype: str, side: str, amount: float, | |
| 547 | + rate: float, params: Dict = {}) -> Dict[str, Any]: | |
| 548 | 548 | order_id = f'dry_run_{side}_{datetime.now().timestamp()}' |
| 549 | 549 | _amount = self.amount_to_precision(pair, amount) |
| 550 | 550 | dry_order = { |
| @@ -618,7 +618,7 @@ | ||
| 618 | 618 | rate: float, time_in_force: str) -> Dict: |
| 619 | 619 | |
| 620 | 620 | if self._config['dry_run']: |
| 621 | - dry_order = self.dry_run_order(pair, ordertype, "buy", amount, rate) | |
| 621 | + dry_order = self.create_dry_run_order(pair, ordertype, "buy", amount, rate) | |
| 622 | 622 | return dry_order |
| 623 | 623 | |
| 624 | 624 | params = self._params.copy() |
| @@ -631,7 +631,7 @@ | ||
| 631 | 631 | rate: float, time_in_force: str = 'gtc') -> Dict: |
| 632 | 632 | |
| 633 | 633 | if self._config['dry_run']: |
| 634 | - dry_order = self.dry_run_order(pair, ordertype, "sell", amount, rate) | |
| 634 | + dry_order = self.create_dry_run_order(pair, ordertype, "sell", amount, rate) | |
| 635 | 635 | return dry_order |
| 636 | 636 | |
| 637 | 637 | params = self._params.copy() |
modified freqtrade/exchange/ftx.py +1 −1
| @@ -53,7 +53,7 @@ | ||
| 53 | 53 | stop_price = self.price_to_precision(pair, stop_price) |
| 54 | 54 | |
| 55 | 55 | if self._config['dry_run']: |
| 56 | - dry_order = self.dry_run_order( | |
| 56 | + dry_order = self.create_dry_run_order( | |
| 57 | 57 | pair, ordertype, "sell", amount, stop_price) |
| 58 | 58 | return dry_order |
| 59 | 59 |
modified freqtrade/exchange/kraken.py +1 −1
| @@ -92,7 +92,7 @@ | ||
| 92 | 92 | stop_price = self.price_to_precision(pair, stop_price) |
| 93 | 93 | |
| 94 | 94 | if self._config['dry_run']: |
| 95 | - dry_order = self.dry_run_order( | |
| 95 | + dry_order = self.create_dry_run_order( | |
| 96 | 96 | pair, ordertype, "sell", amount, stop_price) |
| 97 | 97 | return dry_order |
| 98 | 98 |
modified tests/exchange/test_exchange.py +2 −2
| @@ -931,11 +931,11 @@ | ||
| 931 | 931 | ("sell") |
| 932 | 932 | ]) |
| 933 | 933 | @pytest.mark.parametrize("exchange_name", EXCHANGES) |
| 934 | -def test_dry_run_order(default_conf, mocker, side, exchange_name): | |
| 934 | +def test_create_dry_run_order(default_conf, mocker, side, exchange_name): | |
| 935 | 935 | default_conf['dry_run'] = True |
| 936 | 936 | exchange = get_patched_exchange(mocker, default_conf, id=exchange_name) |
| 937 | 937 | |
| 938 | - order = exchange.dry_run_order( | |
| 938 | + order = exchange.create_dry_run_order( | |
| 939 | 939 | pair='ETH/BTC', ordertype='limit', side=side, amount=1, rate=200) |
| 940 | 940 | assert 'id' in order |
| 941 | 941 | assert f'dry_run_{side}_' in order["id"] |