diff --git a/freqtrade/analyze.py b/freqtrade/analyze.py index 4a073c3bd..7de3e95b2 100644 --- a/freqtrade/analyze.py +++ b/freqtrade/analyze.py @@ -208,7 +208,8 @@ class Analyze(object): "HIT STOP: current price at {:.6f}, stop loss is {:.6f}, " "initial stop loss was at {:.6f}, trade opened at {:.6f}".format( current_rate, trade.stop_loss, trade.initial_stop_loss, trade.open_rate)) - logger.debug("trailing stop saved us: {:.6f}".format(trade.stop_loss - trade.initial_stop_loss)) + logger.debug("trailing stop saved us: {:.6f}" + .format(trade.stop_loss - trade.initial_stop_loss)) logger.debug('Stop loss hit.') return True diff --git a/freqtrade/persistence.py b/freqtrade/persistence.py index a34b1b6c9..67cae492c 100644 --- a/freqtrade/persistence.py +++ b/freqtrade/persistence.py @@ -95,9 +95,12 @@ class Trade(_DECL_BASE): open_date = Column(DateTime, nullable=False, default=datetime.utcnow) close_date = Column(DateTime) open_order_id = Column(String) - stop_loss = Column(Float, nullable=False, default=0.0) # absolute value of the stop loss - initial_stop_loss = Column(Float, nullable=False, default=0.0) # absolute value of the initial stop loss - max_rate = Column(Float, nullable=False, default=0.0) # absolute value of the highest reached price + # absolute value of the stop loss + stop_loss = Column(Float, nullable=False, default=0.0) + # absolute value of the initial stop loss + initial_stop_loss = Column(Float, nullable=False, default=0.0) + # absolute value of the highest reached price + max_rate = Column(Float, nullable=False, default=0.0) def __repr__(self): return 'Trade(id={}, pair={}, amount={:.8f}, open_rate={:.8f}, open_since={})'.format(