move initial logic to persistence

This commit is contained in:
xmatthias
2018-06-27 06:38:49 +02:00
parent a91d75b3b2
commit c997aa9864
3 changed files with 25 additions and 10 deletions

View File

@@ -212,9 +212,8 @@ class Analyze(object):
current_profit = trade.calc_profit_percent(current_rate)
trailing_stop = self.config.get('trailing_stop', False)
if trade.stop_loss is None or trade.stop_loss == 0:
# initially adjust the stop loss to the base value
trade.adjust_stop_loss(trade.open_rate, self.strategy.stoploss)
trade.adjust_stop_loss(trade.open_rate, self.strategy.stoploss, initial=True)
# evaluate if the stoploss was hit
if self.strategy.stoploss is not None and trade.stop_loss >= current_rate: