added stop loss, extra verbose logging for now, will be changed once the algorithm is prooven

This commit is contained in:
Gert Wohlgemuth
2018-05-10 20:56:16 -07:00
parent 250e84a42a
commit d928be505f
2 changed files with 33 additions and 4 deletions

View File

@@ -202,6 +202,15 @@ class Analyze(object):
# evaluate if the stoploss was hit
if self.strategy.stoploss is not None and trade.stop_loss >= current_rate:
# just for debugging
if 'trailing_stop' in self.config and self.config['trailing_stop']:
print(
"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))
print("trailing stop saved us: {:.6f}".format(trade.stop_loss - trade.initial_stop_loss))
logger.debug('Stop loss hit.')
return True