|
@@ -314,21 +314,22 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
pnl_emoji = "🟢" if unrealized_pnl >= 0 else "🔴"
|
|
|
exit_emoji = "🔴" if position_type == "LONG" else "🟢"
|
|
|
|
|
|
+ formatter = get_formatter()
|
|
|
confirmation_text = f"""
|
|
|
{exit_emoji} <b>Exit Position Confirmation</b>
|
|
|
|
|
|
📊 <b>Position Details:</b>
|
|
|
• Token: {token}
|
|
|
• Position: {position_type}
|
|
|
-• Size: {get_formatter(contracts)} contracts
|
|
|
-• Entry Price: {get_formatter(entry_price)}
|
|
|
-• Current Price: {get_formatter(current_price)}
|
|
|
-• {pnl_emoji} Unrealized P&L: {get_formatter(unrealized_pnl)}
|
|
|
+• Size: {contracts:.6f} contracts
|
|
|
+• Entry Price: {formatter.format_price_with_symbol(entry_price, token)}
|
|
|
+• Current Price: {formatter.format_price_with_symbol(current_price, token)}
|
|
|
+• {pnl_emoji} Unrealized P&L: {formatter.format_price_with_symbol(unrealized_pnl)}
|
|
|
|
|
|
🎯 <b>Exit Order:</b>
|
|
|
• Action: {exit_side.upper()} (Close {position_type})
|
|
|
-• Amount: {get_formatter(contracts)} {token}
|
|
|
-• Est. Value: ~{get_formatter(exit_value)}
|
|
|
+• Amount: {contracts:.6f} {token}
|
|
|
+• Est. Value: ~{formatter.format_price_with_symbol(exit_value)}
|
|
|
• Order Type: Market Order
|
|
|
|
|
|
⚠️ <b>Are you sure you want to close this {position_type} position?</b>
|
|
@@ -379,21 +380,23 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
|
|
|
# Validate stop loss price based on position direction
|
|
|
if position_type == "LONG" and stop_price >= entry_price:
|
|
|
+ formatter = get_formatter()
|
|
|
await context.bot.send_message(chat_id=chat_id, text=(
|
|
|
f"⚠️ Stop loss price should be BELOW entry price for long positions\n\n"
|
|
|
f"📊 Your {token} LONG position:\n"
|
|
|
- f"• Entry Price: {get_formatter(entry_price)}\n"
|
|
|
- f"• Stop Price: {get_formatter(stop_price)} ❌\n\n"
|
|
|
- f"💡 Try a lower price like: /sl {token} {get_formatter(entry_price * 0.95)}\n"
|
|
|
+ f"• Entry Price: {formatter.format_price_with_symbol(entry_price, token)}\n"
|
|
|
+ f"• Stop Price: {formatter.format_price_with_symbol(stop_price, token)} ❌\n\n"
|
|
|
+ f"💡 Try a lower price like: /sl {token} {formatter.format_price(entry_price * 0.95, token)}\n"
|
|
|
))
|
|
|
return
|
|
|
elif position_type == "SHORT" and stop_price <= entry_price:
|
|
|
+ formatter = get_formatter()
|
|
|
await context.bot.send_message(chat_id=chat_id, text=(
|
|
|
f"⚠️ Stop loss price should be ABOVE entry price for short positions\n\n"
|
|
|
f"📊 Your {token} SHORT position:\n"
|
|
|
- f"• Entry Price: {get_formatter(entry_price)}\n"
|
|
|
- f"• Stop Price: {get_formatter(stop_price)} ❌\n\n"
|
|
|
- f"💡 Try a higher price like: /sl {token} {get_formatter(entry_price * 1.05)}\n"
|
|
|
+ f"• Entry Price: {formatter.format_price_with_symbol(entry_price, token)}\n"
|
|
|
+ f"• Stop Price: {formatter.format_price_with_symbol(stop_price, token)} ❌\n\n"
|
|
|
+ f"💡 Try a higher price like: /sl {token} {formatter.format_price(entry_price * 1.05, token)}\n"
|
|
|
))
|
|
|
return
|
|
|
|
|
@@ -411,26 +414,27 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
|
|
|
pnl_emoji = "🟢" if pnl_at_stop >= 0 else "🔴"
|
|
|
|
|
|
+ formatter = get_formatter()
|
|
|
confirmation_text = f"""
|
|
|
🛑 <b>Stop Loss Order Confirmation</b>
|
|
|
|
|
|
📊 <b>Position Details:</b>
|
|
|
• Token: {token}
|
|
|
• Position: {position_type}
|
|
|
-• Size: {get_formatter(contracts)} contracts
|
|
|
-• Entry Price: {get_formatter(entry_price)}
|
|
|
-• Current Price: {get_formatter(current_price)}
|
|
|
+• Size: {contracts:.6f} contracts
|
|
|
+• Entry Price: {formatter.format_price_with_symbol(entry_price, token)}
|
|
|
+• Current Price: {formatter.format_price_with_symbol(current_price, token)}
|
|
|
|
|
|
🎯 <b>Stop Loss Order:</b>
|
|
|
-• Stop Price: {get_formatter(stop_price)}
|
|
|
+• Stop Price: {formatter.format_price_with_symbol(stop_price, token)}
|
|
|
• Action: {exit_side.upper()} (Close {position_type})
|
|
|
-• Amount: {get_formatter(contracts)} {token}
|
|
|
+• Amount: {contracts:.6f} {token}
|
|
|
• Order Type: Limit Order
|
|
|
-• {pnl_emoji} Est. P&L: {get_formatter(pnl_at_stop)}
|
|
|
+• {pnl_emoji} Est. P&L: {formatter.format_price_with_symbol(pnl_at_stop)}
|
|
|
|
|
|
⚠️ <b>Are you sure you want to set this stop loss?</b>
|
|
|
|
|
|
-This will place a limit {exit_side} order at {get_formatter(stop_price)} to protect your {position_type} position.
|
|
|
+This will place a limit {exit_side} order at {formatter.format_price_with_symbol(stop_price, token)} to protect your {position_type} position.
|
|
|
"""
|
|
|
|
|
|
keyboard = [
|
|
@@ -480,21 +484,23 @@ This will place a limit {exit_side} order at {get_formatter(stop_price)} to prot
|
|
|
|
|
|
# Validate take profit price based on position direction
|
|
|
if position_type == "LONG" and tp_price <= entry_price:
|
|
|
+ formatter = get_formatter()
|
|
|
await context.bot.send_message(chat_id=chat_id, text=(
|
|
|
f"⚠️ Take profit price should be ABOVE entry price for long positions\n\n"
|
|
|
f"📊 Your {token} LONG position:\n"
|
|
|
- f"• Entry Price: {get_formatter(entry_price)}\n"
|
|
|
- f"• Take Profit: {get_formatter(tp_price)} ❌\n\n"
|
|
|
- f"💡 Try a higher price like: /tp {token} {get_formatter(entry_price * 1.05)}\n"
|
|
|
+ f"• Entry Price: {formatter.format_price_with_symbol(entry_price, token)}\n"
|
|
|
+ f"• Take Profit: {formatter.format_price_with_symbol(tp_price, token)} ❌\n\n"
|
|
|
+ f"💡 Try a higher price like: /tp {token} {formatter.format_price(entry_price * 1.05, token)}\n"
|
|
|
))
|
|
|
return
|
|
|
elif position_type == "SHORT" and tp_price >= entry_price:
|
|
|
+ formatter = get_formatter()
|
|
|
await context.bot.send_message(chat_id=chat_id, text=(
|
|
|
f"⚠️ Take profit price should be BELOW entry price for short positions\n\n"
|
|
|
f"📊 Your {token} SHORT position:\n"
|
|
|
- f"• Entry Price: {get_formatter(entry_price)}\n"
|
|
|
- f"• Take Profit: {get_formatter(tp_price)} ❌\n\n"
|
|
|
- f"💡 Try a lower price like: /tp {token} {get_formatter(entry_price * 0.95)}\n"
|
|
|
+ f"• Entry Price: {formatter.format_price_with_symbol(entry_price, token)}\n"
|
|
|
+ f"• Take Profit: {formatter.format_price_with_symbol(tp_price, token)} ❌\n\n"
|
|
|
+ f"💡 Try a lower price like: /tp {token} {formatter.format_price(entry_price * 0.95, token)}\n"
|
|
|
))
|
|
|
return
|
|
|
|
|
@@ -512,26 +518,27 @@ This will place a limit {exit_side} order at {get_formatter(stop_price)} to prot
|
|
|
|
|
|
pnl_emoji = "🟢" if pnl_at_tp >= 0 else "🔴"
|
|
|
|
|
|
+ formatter = get_formatter()
|
|
|
confirmation_text = f"""
|
|
|
🎯 <b>Take Profit Order Confirmation</b>
|
|
|
|
|
|
📊 <b>Position Details:</b>
|
|
|
• Token: {token}
|
|
|
• Position: {position_type}
|
|
|
-• Size: {get_formatter(contracts)} contracts
|
|
|
-• Entry Price: {get_formatter(entry_price)}
|
|
|
-• Current Price: {get_formatter(current_price)}
|
|
|
+• Size: {contracts:.6f} contracts
|
|
|
+• Entry Price: {formatter.format_price_with_symbol(entry_price, token)}
|
|
|
+• Current Price: {formatter.format_price_with_symbol(current_price, token)}
|
|
|
|
|
|
🎯 <b>Take Profit Order:</b>
|
|
|
-• Take Profit Price: {get_formatter(tp_price)}
|
|
|
+• Take Profit Price: {formatter.format_price_with_symbol(tp_price, token)}
|
|
|
• Action: {exit_side.upper()} (Close {position_type})
|
|
|
-• Amount: {get_formatter(contracts)} {token}
|
|
|
+• Amount: {contracts:.6f} {token}
|
|
|
• Order Type: Limit Order
|
|
|
-• {pnl_emoji} Est. P&L: {get_formatter(pnl_at_tp)}
|
|
|
+• {pnl_emoji} Est. P&L: {formatter.format_price_with_symbol(pnl_at_tp)}
|
|
|
|
|
|
⚠️ <b>Are you sure you want to set this take profit?</b>
|
|
|
|
|
|
-This will place a limit {exit_side} order at {get_formatter(tp_price)} to secure profits from your {position_type} position.
|
|
|
+This will place a limit {exit_side} order at {formatter.format_price_with_symbol(tp_price, token)} to secure profits from your {position_type} position.
|
|
|
"""
|
|
|
|
|
|
keyboard = [
|