|
@@ -36,18 +36,20 @@ class DailyCommands(InfoCommandsBase):
|
|
|
|
|
|
period_lines = []
|
|
|
for day_stats_item in daily_stats_list:
|
|
|
- if day_stats_item['has_trades']:
|
|
|
- pnl_emoji = "🟢" if day_stats_item['pnl'] >= 0 else "🔴"
|
|
|
- pnl_str = formatter.format_price_with_symbol(day_stats_item['pnl'])
|
|
|
+ if day_stats_item.get('has_trades'):
|
|
|
+ pnl_emoji = "🟢" if day_stats_item.get('pnl', 0) >= 0 else "🔴"
|
|
|
+ pnl_str = formatter.format_price_with_symbol(day_stats_item.get('pnl', 0))
|
|
|
roe = day_stats_item.get('roe', 0.0) # Get ROE from stats
|
|
|
roe_str = f"ROE: {roe:+.1f}%" if roe != 0 else ""
|
|
|
- period_lines.append(f"📅 <b>{day_stats_item['day_formatted']}</b>: {pnl_emoji} {pnl_str} ({day_stats_item['pnl_pct']:+.1f}%) {roe_str} | Trades: {day_stats_item['trades']}")
|
|
|
- total_pnl_all_days += day_stats_item['pnl']
|
|
|
- total_trades_all_days += day_stats_item['trades']
|
|
|
+ day_str = day_stats_item.get('day', 'Unknown')
|
|
|
+ period_lines.append(f"📅 <b>{day_str}</b>: {pnl_emoji} {pnl_str} ({day_stats_item.get('pnl_pct', 0):+.1f}%) {roe_str} | Trades: {day_stats_item.get('trades', 0)}")
|
|
|
+ total_pnl_all_days += day_stats_item.get('pnl', 0)
|
|
|
+ total_trades_all_days += day_stats_item.get('trades', 0)
|
|
|
total_roe_all_days += roe
|
|
|
trading_days_count += 1
|
|
|
else:
|
|
|
- period_lines.append(f"📅 <b>{day_stats_item['day_formatted']}</b>: 📭 No trading activity")
|
|
|
+ day_str = day_stats_item.get('day', 'Unknown')
|
|
|
+ period_lines.append(f"📅 <b>{day_str}</b>: 📭 No trading activity")
|
|
|
|
|
|
if period_lines:
|
|
|
daily_text_parts.append("\n".join(period_lines))
|