rpc f8x
This commit is contained in:
parent
a37e2c49fe
commit
63497fdc8b
@ -1232,7 +1232,7 @@ class FreqtradeBot(LoggingMixin):
|
||||
trade.open_order_id = order['id']
|
||||
trade.sell_order_status = ''
|
||||
trade.close_rate_requested = limit
|
||||
trade.sell_reason = exit_tag or sell_reason.sell_reason
|
||||
trade.sell_reason = exit_tag or sell_reason.sell_reason + order['id'] + ' debug'
|
||||
|
||||
# Lock pair for one candle to prevent immediate re-buys
|
||||
self.strategy.lock_pair(trade.pair, datetime.now(timezone.utc),
|
||||
@ -1258,10 +1258,14 @@ class FreqtradeBot(LoggingMixin):
|
||||
if sub_trade:
|
||||
amount = order.get('filled') or order.get('amount') or 0
|
||||
profit_rate = order.get('average') or order.get('price') or 0
|
||||
profit_ratio = trade.close_profit
|
||||
profit = (trade.close_profit_abs if fill
|
||||
else trade.process_sell_sub_trade(order, is_closed=False))
|
||||
sell_stake_amount = profit_rate * amount * (1 - self.fee_close)
|
||||
logger.info(order)
|
||||
if fill:
|
||||
profit_ratio = trade.close_profit
|
||||
profit = trade.close_profit_abs
|
||||
else:
|
||||
profit = trade.process_sell_sub_trade(order, is_closed=False)
|
||||
profit_ratio = sell_stake_amount / (sell_stake_amount - profit) -1
|
||||
|
||||
open_rate = trade.get_open_rate(profit, profit_rate, amount)
|
||||
else:
|
||||
|
@ -233,10 +233,11 @@ class RPC:
|
||||
except (PricingError, ExchangeError):
|
||||
current_rate = NAN
|
||||
if show_order:
|
||||
b_order = trade.select_order('buy', is_open=False)
|
||||
b_order = trade.select_order('buy', is_open=True)
|
||||
amount = b_order.filled or b_order.amount
|
||||
open_rate = b_order.average or b_order.price
|
||||
open_cost=open_rate * amount * (1+ trade.fee_open)
|
||||
logger.info(b_order)
|
||||
trade_profit = trade.calc_profit2(open_rate, current_rate, amount)
|
||||
profit_pct = ( open_cost + trade_profit)/open_cost - 1
|
||||
profit_str = f'{profit_pct:.2%}'
|
||||
|
@ -86,8 +86,8 @@ class Worker:
|
||||
# Log state transition
|
||||
if state != old_state:
|
||||
|
||||
# if old_state != State.RELOAD_CONFIG:
|
||||
# self.freqtrade.notify_status(f'{state.name.lower()}')
|
||||
if state != State.RELOAD_CONFIG:
|
||||
self.freqtrade.notify_status(f'{state.name.lower()}')
|
||||
|
||||
logger.info(
|
||||
f"Changing state{f' from {old_state.name}' if old_state else ''} to: {state.name}")
|
||||
|
Loading…
Reference in New Issue
Block a user