Merge branch 'feat/short' into fs_fix
This commit is contained in:
@@ -507,7 +507,6 @@ class FreqtradeBot(LoggingMixin):
|
||||
If the strategy triggers the adjustment, a new order gets issued.
|
||||
Once that completes, the existing trade is modified to match new data.
|
||||
"""
|
||||
# TODO-lev: Check what changes are necessary for DCA in relation to shorts.
|
||||
if self.strategy.max_entry_position_adjustment > -1:
|
||||
count_of_buys = trade.nr_of_successful_entries
|
||||
if count_of_buys > self.strategy.max_entry_position_adjustment:
|
||||
@@ -1077,7 +1076,9 @@ class FreqtradeBot(LoggingMixin):
|
||||
:param order: Current on exchange stoploss order
|
||||
:return: None
|
||||
"""
|
||||
if self.exchange.stoploss_adjust(trade.stop_loss, order, side=trade.exit_side):
|
||||
stoploss_norm = self.exchange.price_to_precision(trade.pair, trade.stop_loss)
|
||||
|
||||
if self.exchange.stoploss_adjust(stoploss_norm, order, side=trade.exit_side):
|
||||
# we check if the update is necessary
|
||||
update_beat = self.strategy.order_types.get('stoploss_on_exchange_interval', 60)
|
||||
if (datetime.utcnow() - trade.stoploss_last_update).total_seconds() >= update_beat:
|
||||
|
@@ -23,6 +23,7 @@ coingecko_mapping = {
|
||||
'eth': 'ethereum',
|
||||
'bnb': 'binancecoin',
|
||||
'sol': 'solana',
|
||||
'usdt': 'tether',
|
||||
}
|
||||
|
||||
|
||||
|
@@ -586,6 +586,9 @@ class RPC:
|
||||
if coin == stake_currency:
|
||||
rate = 1.0
|
||||
est_stake = balance.total
|
||||
if self._config.get('trading_mode', TradingMode.SPOT) != TradingMode.SPOT:
|
||||
# in Futures, "total" includes the locked stake, and therefore all positions
|
||||
est_stake = balance.free
|
||||
else:
|
||||
try:
|
||||
pair = self._freqtrade.exchange.get_valid_pair_combination(coin, stake_currency)
|
||||
@@ -614,6 +617,7 @@ class RPC:
|
||||
symbol: str
|
||||
position: PositionWallet
|
||||
for symbol, position in self._freqtrade.wallets.get_all_positions().items():
|
||||
total += position.collateral
|
||||
|
||||
currencies.append({
|
||||
'currency': symbol,
|
||||
|
@@ -104,16 +104,16 @@ class Wallets:
|
||||
size = position.amount
|
||||
collateral = position.stake_amount
|
||||
leverage = position.leverage
|
||||
tot_in_trades -= collateral
|
||||
tot_in_trades += collateral
|
||||
_positions[position.pair] = PositionWallet(
|
||||
position.pair, position=size,
|
||||
leverage=leverage,
|
||||
collateral=collateral,
|
||||
side=position.trade_direction
|
||||
)
|
||||
current_stake = self.start_cap + tot_profit
|
||||
current_stake = self.start_cap + tot_profit - tot_in_trades
|
||||
used_stake = tot_in_trades
|
||||
total_stake = current_stake - tot_in_trades
|
||||
total_stake = current_stake + tot_in_trades
|
||||
|
||||
_wallets[self._config['stake_currency']] = Wallet(
|
||||
currency=self._config['stake_currency'],
|
||||
|
Reference in New Issue
Block a user