Merge pull request #6692 from eSeR1805/feat_readjust_entry

Feature: Readjust Entry Order
This commit is contained in:
Matthias
2022-05-07 20:11:20 +02:00
committed by GitHub
13 changed files with 594 additions and 97 deletions

View File

@@ -219,11 +219,15 @@ class Order(_DECL_BASE):
'remaining': self.remaining,
}
def close_bt_order(self, close_date: datetime):
def close_bt_order(self, close_date: datetime, trade: 'LocalTrade'):
self.order_filled_date = close_date
self.filled = self.amount
self.status = 'closed'
self.ft_is_open = False
if (self.ft_order_side == trade.entry_side
and len(trade.select_filled_orders(trade.entry_side)) == 1):
trade.open_rate = self.price
trade.recalc_open_trade_value()
@staticmethod
def update_orders(orders: List['Order'], order: Dict[str, Any]):