Small enhancements and notes

This commit is contained in:
Matthias 2022-02-13 14:33:37 +01:00
parent ee5f05208e
commit 2523c12c71
2 changed files with 5 additions and 1 deletions

View File

@ -499,7 +499,7 @@ class Exchange:
# Note: ccxt has BaseCurrency/QuoteCurrency format for pairs
if self.markets and pair not in self.markets:
raise OperationalException(
f'Pair {pair} is not available on {self.name}. '
f'Pair {pair} is not available on {self.name} {self.trading_mode.value}. '
f'Please remove {pair} from your whitelist.')
# From ccxt Documentation:

View File

@ -740,6 +740,9 @@ class FreqtradeBot(LoggingMixin):
# in case of FOK the order may be filled immediately and fully
elif order_status == 'closed':
# TODO-lev: Evaluate this. Why is setting stake_amount here necessary?
# it should never change in theory - and in case of leveraged orders,
# may be the leveraged amount.
stake_amount = order['cost']
amount = safe_value_fallback(order, 'filled', 'amount')
enter_limit_filled_price = safe_value_fallback(order, 'average', 'price')
@ -1288,6 +1291,7 @@ class FreqtradeBot(LoggingMixin):
# * Check edge cases, we don't want to make leverage > 1.0 if we don't have to
# * (for leverage modes which aren't isolated futures)
# TODO-lev: The below calculation needs to include leverage ...
trade.stake_amount = trade.amount * trade.open_rate
self.update_trade_state(trade, trade.open_order_id, corder)