From 40630875ab4d5e7e9966d37b9b43a2e0e651a2cd Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Sun, 13 May 2018 15:19:27 -0700 Subject: [PATCH] fixed flake error, they are really to stringent! --- freqtrade/analyze.py | 3 ++- freqtrade/persistence.py | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) 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(