fixed flake error, they are really to stringent!

This commit is contained in:
Gert Wohlgemuth 2018-05-13 15:19:27 -07:00
parent f8da1bf5a6
commit 40630875ab
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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(