slight update to persistence
This commit is contained in:
parent
243c36b39b
commit
5015bc9bb0
@ -176,7 +176,7 @@ class Trade(_DECL_BASE):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
new_loss = Decimal(current_price * (1 - abs(stoploss)))
|
new_loss = float(current_price * (1 - abs(stoploss)))
|
||||||
|
|
||||||
# keeping track of the highest observed rate for this trade
|
# keeping track of the highest observed rate for this trade
|
||||||
if self.max_rate is None:
|
if self.max_rate is None:
|
||||||
@ -200,15 +200,13 @@ class Trade(_DECL_BASE):
|
|||||||
logger.debug("keeping current stop loss")
|
logger.debug("keeping current stop loss")
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"{} - current price {:.8f}, bought at {:.8f} and calculated "
|
f"{self.pair} - current price {current_price:.8f}, "
|
||||||
"stop loss is at: {:.8f} initial stop at {:.8f}. trailing stop loss saved us: {:.8f} "
|
f"bought at {self.open_rate:.8f} and calculated "
|
||||||
"and max observed rate was {:.8f}".format(
|
f"stop loss is at: {self.initial_stop_loss:.8f} initial "
|
||||||
self.pair, current_price, self.open_rate,
|
f"stop at {self.stop_loss:.8f}. "
|
||||||
self.initial_stop_loss,
|
f"trailing stop loss saved us: "
|
||||||
self.stop_loss, float(self.stop_loss) - float(self.initial_stop_loss),
|
f"{float(self.stop_loss) - float(self.initial_stop_loss):.8f} "
|
||||||
self.max_rate
|
f"and max observed rate was {self.max_rate:.8f}")
|
||||||
|
|
||||||
))
|
|
||||||
|
|
||||||
def update(self, order: Dict) -> None:
|
def update(self, order: Dict) -> None:
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user