Use correct calcuation for "locked in profit"

This commit is contained in:
Matthias
2020-06-04 07:04:32 +02:00
parent 412b50dac5
commit 7bd55aa2f1
2 changed files with 6 additions and 6 deletions

View File

@@ -132,8 +132,8 @@ class RPC:
current_profit = trade.calc_profit_ratio(current_rate)
current_profit_abs = trade.calc_profit(current_rate)
# Calculate guaranteed profit (in case of trailing stop)
stoploss_entrypoint_dist = trade.open_rate - trade.stop_loss
stoploss_entrypoint_dist_ratio = stoploss_entrypoint_dist / trade.stop_loss
stoploss_entry_dist = trade.calc_profit(trade.stop_loss)
stoploss_entry_dist_ratio = trade.calc_profit_ratio(trade.stop_loss)
# calculate distance to stoploss
stoploss_current_dist = trade.stop_loss - current_rate
stoploss_current_dist_ratio = stoploss_current_dist / current_rate
@@ -151,8 +151,8 @@ class RPC:
current_profit_abs=current_profit_abs,
stoploss_current_dist=stoploss_current_dist,
stoploss_current_dist_ratio=round(stoploss_current_dist_ratio, 8),
stoploss_entrypoint_dist=stoploss_entrypoint_dist,
stoploss_entrypoint_dist_ratio=round(stoploss_entrypoint_dist_ratio, 8),
stoploss_entry_dist=stoploss_entry_dist,
stoploss_entry_dist_ratio=round(stoploss_entry_dist_ratio, 8),
open_order='({} {} rem={:.8f})'.format(
order['type'], order['side'], order['remaining']
) if order else None,