Elffuss BraidHub

kikocis/freqtrade public

Rename dry_run_order to create_dry_run_order
Changeseta8d373509c08eec90d3ae3b6ac1c8eb79c2f14f138ae0c2cbddb8ae92d80da75
AuthorMatthias <xmatthias@outlook.com> · 2021-04-10 13:50 +02:00
CommitterMatthias <xmatthias@outlook.com> · 2021-04-10 13:50 +02:00
Parents9c160a67c0ef

Browse the files at this changeset

5 files changed

modified freqtrade/exchange/binance.py +1 −1
@@ -52,7 +52,7 @@
5252 'In stoploss limit order, stop price should be more than limit price')
5353
5454 if self._config['dry_run']:
55- dry_order = self.dry_run_order(
55+ dry_order = self.create_dry_run_order(
5656 pair, ordertype, "sell", amount, stop_price)
5757 return dry_order
5858
modified freqtrade/exchange/exchange.py +4 −4
@@ -543,8 +543,8 @@
543543 # See also #2575 at github.
544544 return max(min_stake_amounts) * amount_reserve_percent
545545
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]:
548548 order_id = f'dry_run_{side}_{datetime.now().timestamp()}'
549549 _amount = self.amount_to_precision(pair, amount)
550550 dry_order = {
@@ -618,7 +618,7 @@
618618 rate: float, time_in_force: str) -> Dict:
619619
620620 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)
622622 return dry_order
623623
624624 params = self._params.copy()
@@ -631,7 +631,7 @@
631631 rate: float, time_in_force: str = 'gtc') -> Dict:
632632
633633 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)
635635 return dry_order
636636
637637 params = self._params.copy()
modified freqtrade/exchange/ftx.py +1 −1
@@ -53,7 +53,7 @@
5353 stop_price = self.price_to_precision(pair, stop_price)
5454
5555 if self._config['dry_run']:
56- dry_order = self.dry_run_order(
56+ dry_order = self.create_dry_run_order(
5757 pair, ordertype, "sell", amount, stop_price)
5858 return dry_order
5959
modified freqtrade/exchange/kraken.py +1 −1
@@ -92,7 +92,7 @@
9292 stop_price = self.price_to_precision(pair, stop_price)
9393
9494 if self._config['dry_run']:
95- dry_order = self.dry_run_order(
95+ dry_order = self.create_dry_run_order(
9696 pair, ordertype, "sell", amount, stop_price)
9797 return dry_order
9898
modified tests/exchange/test_exchange.py +2 −2
@@ -931,11 +931,11 @@
931931 ("sell")
932932 ])
933933 @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):
935935 default_conf['dry_run'] = True
936936 exchange = get_patched_exchange(mocker, default_conf, id=exchange_name)
937937
938- order = exchange.dry_run_order(
938+ order = exchange.create_dry_run_order(
939939 pair='ETH/BTC', ordertype='limit', side=side, amount=1, rate=200)
940940 assert 'id' in order
941941 assert f'dry_run_{side}_' in order["id"]