Don't add default value for ordertype
sort parameters to align with ccxt
This commit is contained in:
parent
543873263a
commit
ef1e20bfe8
@ -249,14 +249,14 @@ class Exchange(object):
|
|||||||
price = ceil(big_price) / pow(10, symbol_prec)
|
price = ceil(big_price) / pow(10, symbol_prec)
|
||||||
return price
|
return price
|
||||||
|
|
||||||
def buy(self, pair: str, rate: float, amount: float, ordertype: str = 'limt') -> Dict:
|
def buy(self, pair: str, ordertype: str, amount: float, rate: float) -> Dict:
|
||||||
if self._conf['dry_run']:
|
if self._conf['dry_run']:
|
||||||
order_id = f'dry_run_buy_{randint(0, 10**6)}'
|
order_id = f'dry_run_buy_{randint(0, 10**6)}'
|
||||||
self._dry_run_open_orders[order_id] = {
|
self._dry_run_open_orders[order_id] = {
|
||||||
'pair': pair,
|
'pair': pair,
|
||||||
'price': rate,
|
'price': rate,
|
||||||
'amount': amount,
|
'amount': amount,
|
||||||
'type': 'limit',
|
'type': ordertype,
|
||||||
'side': 'buy',
|
'side': 'buy',
|
||||||
'remaining': 0.0,
|
'remaining': 0.0,
|
||||||
'datetime': arrow.utcnow().isoformat(),
|
'datetime': arrow.utcnow().isoformat(),
|
||||||
@ -287,14 +287,14 @@ class Exchange(object):
|
|||||||
except ccxt.BaseError as e:
|
except ccxt.BaseError as e:
|
||||||
raise OperationalException(e)
|
raise OperationalException(e)
|
||||||
|
|
||||||
def sell(self, pair: str, rate: float, amount: float, ordertype: str = 'limt') -> Dict:
|
def sell(self, pair: str, ordertype: str, amount: float, rate: float) -> Dict:
|
||||||
if self._conf['dry_run']:
|
if self._conf['dry_run']:
|
||||||
order_id = f'dry_run_sell_{randint(0, 10**6)}'
|
order_id = f'dry_run_sell_{randint(0, 10**6)}'
|
||||||
self._dry_run_open_orders[order_id] = {
|
self._dry_run_open_orders[order_id] = {
|
||||||
'pair': pair,
|
'pair': pair,
|
||||||
'price': rate,
|
'price': rate,
|
||||||
'amount': amount,
|
'amount': amount,
|
||||||
'type': 'limit',
|
'type': ordertype,
|
||||||
'side': 'sell',
|
'side': 'sell',
|
||||||
'remaining': 0.0,
|
'remaining': 0.0,
|
||||||
'datetime': arrow.utcnow().isoformat(),
|
'datetime': arrow.utcnow().isoformat(),
|
||||||
|
@ -475,8 +475,8 @@ class FreqtradeBot(object):
|
|||||||
|
|
||||||
amount = stake_amount / buy_limit
|
amount = stake_amount / buy_limit
|
||||||
|
|
||||||
order_id = self.exchange.buy(pair=pair, rate=buy_limit, amount=amount,
|
order_id = self.exchange.buy(pair=pair, ordertype=self.strategy.order_types['buy'],
|
||||||
ordertype=self.strategy.order_types['buy'])['id']
|
amount=amount, rate=buy_limit)['id']
|
||||||
|
|
||||||
self.rpc.send_msg({
|
self.rpc.send_msg({
|
||||||
'type': RPCMessageType.BUY_NOTIFICATION,
|
'type': RPCMessageType.BUY_NOTIFICATION,
|
||||||
@ -767,8 +767,9 @@ class FreqtradeBot(object):
|
|||||||
if sell_reason in (SellType.STOP_LOSS, SellType.TRAILING_STOP_LOSS):
|
if sell_reason in (SellType.STOP_LOSS, SellType.TRAILING_STOP_LOSS):
|
||||||
sell_type = 'stoploss'
|
sell_type = 'stoploss'
|
||||||
# Execute sell and update trade record
|
# Execute sell and update trade record
|
||||||
order_id = self.exchange.sell(pair=str(trade.pair), rate=limit, amount=trade.amount,
|
order_id = self.exchange.sell(pair=str(trade.pair),
|
||||||
ordertype=self.strategy.order_types[sell_type])['id']
|
ordertype=self.strategy.order_types[sell_type],
|
||||||
|
amount=trade.amount, rate=limit)['id']
|
||||||
trade.open_order_id = order_id
|
trade.open_order_id = order_id
|
||||||
trade.close_rate_requested = limit
|
trade.close_rate_requested = limit
|
||||||
trade.sell_reason = sell_reason.value
|
trade.sell_reason = sell_reason.value
|
||||||
|
Loading…
Reference in New Issue
Block a user