mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-19 06:11:15 +00:00
Merge branch 'develop' into feature_keyval_storage
This commit is contained in:
@@ -288,6 +288,8 @@ class TradeSchema(BaseModel):
|
||||
|
||||
open_date: str
|
||||
open_timestamp: int
|
||||
open_fill_date: Optional[str]
|
||||
open_fill_timestamp: Optional[int]
|
||||
open_rate: float
|
||||
open_rate_requested: Optional[float] = None
|
||||
open_trade_value: float
|
||||
|
||||
@@ -1365,7 +1365,7 @@ class Telegram(RPCHandler):
|
||||
@authorized_only
|
||||
async def _enter_tag_performance(self, update: Update, context: CallbackContext) -> None:
|
||||
"""
|
||||
Handler for /buys PAIR .
|
||||
Handler for /entries PAIR .
|
||||
Shows a performance statistic from finished trades
|
||||
:param bot: telegram bot
|
||||
:param update: message update
|
||||
@@ -1376,28 +1376,28 @@ class Telegram(RPCHandler):
|
||||
pair = context.args[0]
|
||||
|
||||
trades = self._rpc._rpc_enter_tag_performance(pair)
|
||||
output = "<b>Entry Tag Performance:</b>\n"
|
||||
output = "*Entry Tag Performance:*\n"
|
||||
for i, trade in enumerate(trades):
|
||||
stat_line = (
|
||||
f"{i + 1}.\t <code>{trade['enter_tag']}\t"
|
||||
f"{i + 1}.\t `{trade['enter_tag']}\t"
|
||||
f"{fmt_coin(trade['profit_abs'], self._config['stake_currency'])} "
|
||||
f"({trade['profit_ratio']:.2%}) "
|
||||
f"({trade['count']})</code>\n")
|
||||
f"({trade['count']})`\n")
|
||||
|
||||
if len(output + stat_line) >= MAX_MESSAGE_LENGTH:
|
||||
await self._send_msg(output, parse_mode=ParseMode.HTML)
|
||||
await self._send_msg(output, parse_mode=ParseMode.MARKDOWN)
|
||||
output = stat_line
|
||||
else:
|
||||
output += stat_line
|
||||
|
||||
await self._send_msg(output, parse_mode=ParseMode.HTML,
|
||||
await self._send_msg(output, parse_mode=ParseMode.MARKDOWN,
|
||||
reload_able=True, callback_path="update_enter_tag_performance",
|
||||
query=update.callback_query)
|
||||
|
||||
@authorized_only
|
||||
async def _exit_reason_performance(self, update: Update, context: CallbackContext) -> None:
|
||||
"""
|
||||
Handler for /sells.
|
||||
Handler for /exits.
|
||||
Shows a performance statistic from finished trades
|
||||
:param bot: telegram bot
|
||||
:param update: message update
|
||||
@@ -1408,21 +1408,21 @@ class Telegram(RPCHandler):
|
||||
pair = context.args[0]
|
||||
|
||||
trades = self._rpc._rpc_exit_reason_performance(pair)
|
||||
output = "<b>Exit Reason Performance:</b>\n"
|
||||
output = "*Exit Reason Performance:*\n"
|
||||
for i, trade in enumerate(trades):
|
||||
stat_line = (
|
||||
f"{i + 1}.\t <code>{trade['exit_reason']}\t"
|
||||
f"{i + 1}.\t `{trade['exit_reason']}\t"
|
||||
f"{fmt_coin(trade['profit_abs'], self._config['stake_currency'])} "
|
||||
f"({trade['profit_ratio']:.2%}) "
|
||||
f"({trade['count']})</code>\n")
|
||||
f"({trade['count']})`\n")
|
||||
|
||||
if len(output + stat_line) >= MAX_MESSAGE_LENGTH:
|
||||
await self._send_msg(output, parse_mode=ParseMode.HTML)
|
||||
await self._send_msg(output, parse_mode=ParseMode.MARKDOWN)
|
||||
output = stat_line
|
||||
else:
|
||||
output += stat_line
|
||||
|
||||
await self._send_msg(output, parse_mode=ParseMode.HTML,
|
||||
await self._send_msg(output, parse_mode=ParseMode.MARKDOWN,
|
||||
reload_able=True, callback_path="update_exit_reason_performance",
|
||||
query=update.callback_query)
|
||||
|
||||
@@ -1440,21 +1440,21 @@ class Telegram(RPCHandler):
|
||||
pair = context.args[0]
|
||||
|
||||
trades = self._rpc._rpc_mix_tag_performance(pair)
|
||||
output = "<b>Mix Tag Performance:</b>\n"
|
||||
output = "*Mix Tag Performance:*\n"
|
||||
for i, trade in enumerate(trades):
|
||||
stat_line = (
|
||||
f"{i + 1}.\t <code>{trade['mix_tag']}\t"
|
||||
f"{i + 1}.\t `{trade['mix_tag']}\t"
|
||||
f"{fmt_coin(trade['profit_abs'], self._config['stake_currency'])} "
|
||||
f"({trade['profit_ratio']:.2%}) "
|
||||
f"({trade['count']})</code>\n")
|
||||
f"({trade['count']})`\n")
|
||||
|
||||
if len(output + stat_line) >= MAX_MESSAGE_LENGTH:
|
||||
await self._send_msg(output, parse_mode=ParseMode.HTML)
|
||||
await self._send_msg(output, parse_mode=ParseMode.MARKDOWN)
|
||||
output = stat_line
|
||||
else:
|
||||
output += stat_line
|
||||
|
||||
await self._send_msg(output, parse_mode=ParseMode.HTML,
|
||||
await self._send_msg(output, parse_mode=ParseMode.MARKDOWN,
|
||||
reload_able=True, callback_path="update_mix_tag_performance",
|
||||
query=update.callback_query)
|
||||
|
||||
@@ -1677,8 +1677,8 @@ class Telegram(RPCHandler):
|
||||
" *table :* `will display trades in a table`\n"
|
||||
" `pending buy orders are marked with an asterisk (*)`\n"
|
||||
" `pending sell orders are marked with a double asterisk (**)`\n"
|
||||
"*/buys <pair|none>:* `Shows the enter_tag performance`\n"
|
||||
"*/sells <pair|none>:* `Shows the exit reason performance`\n"
|
||||
"*/entries <pair|none>:* `Shows the enter_tag performance`\n"
|
||||
"*/exits <pair|none>:* `Shows the exit reason performance`\n"
|
||||
"*/mix_tags <pair|none>:* `Shows combined entry tag + exit reason performance`\n"
|
||||
"*/trades [limit]:* `Lists last closed trades (limited to 10 by default)`\n"
|
||||
"*/profit [<n>]:* `Lists cumulative profit from all finished trades, "
|
||||
|
||||
Reference in New Issue
Block a user