Switched close_reason back to sell_reason

This commit is contained in:
Sam Germain
2021-06-20 02:53:59 -06:00
parent 73dbc7a2f4
commit e198d7f3d2
17 changed files with 79 additions and 79 deletions

View File

@@ -44,8 +44,8 @@ class StoplossGuard(IProtection):
# filters = [
# Trade.is_open.is_(False),
# Trade.close_date > look_back_until,
# or_(Trade.close_reason == SellType.STOP_LOSS.value,
# and_(Trade.close_reason == SellType.TRAILING_STOP_LOSS.value,
# or_(Trade.sell_reason == SellType.STOP_LOSS.value,
# and_(Trade.sell_reason == SellType.TRAILING_STOP_LOSS.value,
# Trade.close_profit < 0))
# ]
# if pair:
@@ -53,7 +53,7 @@ class StoplossGuard(IProtection):
# trades = Trade.get_trades(filters).all()
trades1 = Trade.get_trades_proxy(pair=pair, is_open=False, close_date=look_back_until)
trades = [trade for trade in trades1 if (str(trade.close_reason) in (
trades = [trade for trade in trades1 if (str(trade.sell_reason) in (
SellType.TRAILING_STOP_LOSS.value, SellType.STOP_LOSS.value,
SellType.STOPLOSS_ON_EXCHANGE.value)
and trade.close_profit and trade.close_profit < 0)]