move initial logic to persistence
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user