Update wording to entry/exit
This commit is contained in:
@@ -172,6 +172,7 @@ class Order(_DECL_BASE):
|
||||
'cost': self.cost if self.cost else 0,
|
||||
'filled': self.filled,
|
||||
'ft_order_side': self.ft_order_side,
|
||||
'is_open': self.ft_is_open,
|
||||
'order_date': self.order_date.strftime(DATETIME_PRINT_FORMAT)
|
||||
if self.order_date else None,
|
||||
'order_timestamp': int(self.order_date.replace(
|
||||
@@ -181,6 +182,7 @@ class Order(_DECL_BASE):
|
||||
'order_filled_timestamp': int(self.order_filled_date.replace(
|
||||
tzinfo=timezone.utc).timestamp() * 1000) if self.order_filled_date else None,
|
||||
'order_type': self.order_type,
|
||||
'pair': self.ft_pair,
|
||||
'price': self.price,
|
||||
'remaining': self.remaining,
|
||||
'status': self.status,
|
||||
@@ -304,14 +306,14 @@ class LocalTrade():
|
||||
|
||||
def to_json(self) -> Dict[str, Any]:
|
||||
filled_orders = self.select_filled_orders()
|
||||
filled_buys = []
|
||||
filled_sells = []
|
||||
filled_entries = []
|
||||
filled_exits = []
|
||||
if len(filled_orders) > 0:
|
||||
for x in range(len(filled_orders)):
|
||||
if filled_orders[x].ft_order_side == 'buy':
|
||||
filled_buys.append(filled_orders[x].to_json())
|
||||
elif filled_orders[x].ft_order_side == 'sell':
|
||||
filled_sells.append(filled_orders[x].to_json())
|
||||
for order in filled_orders:
|
||||
if order.ft_order_side == 'buy':
|
||||
filled_entries.append(order.to_json())
|
||||
if order.ft_order_side == 'sell':
|
||||
filled_exits.append(order.to_json())
|
||||
|
||||
return {
|
||||
'trade_id': self.id,
|
||||
@@ -376,8 +378,8 @@ class LocalTrade():
|
||||
'max_rate': self.max_rate,
|
||||
|
||||
'open_order_id': self.open_order_id,
|
||||
'filled_buys': filled_buys,
|
||||
'filled_sells': filled_sells,
|
||||
'filled_entry_orders': filled_entries,
|
||||
'filled_exit_orders': filled_exits,
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
|
@@ -437,7 +437,7 @@ class Telegram(RPCHandler):
|
||||
messages = []
|
||||
for r in results:
|
||||
r['open_date_hum'] = arrow.get(r['open_date']).humanize()
|
||||
r['num_buys'] = len(r['filled_buys'])
|
||||
r['num_entries'] = len(r['filled_entry_orders'])
|
||||
r['sell_reason'] = r.get('sell_reason', "")
|
||||
r['position_adjustment_enable'] = r.get('position_adjustment_enable', False)
|
||||
lines = [
|
||||
@@ -478,8 +478,9 @@ class Telegram(RPCHandler):
|
||||
else:
|
||||
lines.append("*Open Order:* `{open_order}`")
|
||||
|
||||
if len(r['filled_buys']) > 1:
|
||||
lines_detail = self._prepare_buy_details(r['filled_buys'], r['base_currency'])
|
||||
if len(r['filled_entry_orders']) > 1:
|
||||
lines_detail = self._prepare_buy_details(
|
||||
r['filled_entry_orders'], r['base_currency'])
|
||||
lines.extend(lines_detail)
|
||||
|
||||
# Filter empty lines using list-comprehension
|
||||
|
Reference in New Issue
Block a user