Use oppen_rate instead of artificial defaults
This commit is contained in:
parent
fc360608b7
commit
2d4a2fd10b
@ -209,8 +209,8 @@ class Trade(_DECL_BASE):
|
||||
Adjust the max_rate and min_rate.
|
||||
"""
|
||||
logger.debug("Adjusting min/max rates")
|
||||
self.max_rate = max(current_price, self.max_rate or 0.0)
|
||||
self.min_rate = min(current_price, self.min_rate or 10000000.0)
|
||||
self.max_rate = max(current_price, self.max_rate or self.open_rate)
|
||||
self.min_rate = min(current_price, self.min_rate or self.open_rate)
|
||||
|
||||
def adjust_stop_loss(self, current_price: float, stoploss: float, initial: bool = False):
|
||||
"""this adjusts the stop loss to it's most recently observed setting"""
|
||||
|
@ -301,8 +301,9 @@ class IStrategy(ABC):
|
||||
|
||||
# evaluate if the stoploss was hit if stoploss is not on exchange
|
||||
if ((self.stoploss is not None) and
|
||||
(trade.stop_loss >= current_rate) and
|
||||
(not self.order_types.get('stoploss_on_exchange'))):
|
||||
(trade.stop_loss >= current_rate) and
|
||||
(not self.order_types.get('stoploss_on_exchange'))):
|
||||
|
||||
selltype = SellType.STOP_LOSS
|
||||
# If Trailing stop (and max-rate did move above open rate)
|
||||
if trailing_stop and trade.open_rate != trade.max_rate:
|
||||
|
Loading…
Reference in New Issue
Block a user