|
@@ -108,9 +108,9 @@ class TradingCommands:
|
|
|
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 order:\n"
|
|
|
- f"• Entry Price: {formatter.format_price_with_symbol(price, token)}\n"
|
|
|
- f"• Stop Loss: {formatter.format_price_with_symbol(stop_loss_price, token)} ❌\n\n"
|
|
|
- f"💡 Try a lower stop loss like: sl:{formatter.format_price(price * 0.95, token)}"
|
|
|
+ f"• Entry Price: {await formatter.format_price_with_symbol(price, token)}\n"
|
|
|
+ f"• Stop Loss: {await formatter.format_price_with_symbol(stop_loss_price, token)} ❌\n\n"
|
|
|
+ f"💡 Try a lower stop loss like: sl:{await formatter.format_price(price * 0.95, token)}"
|
|
|
))
|
|
|
return
|
|
|
|
|
@@ -121,16 +121,16 @@ class TradingCommands:
|
|
|
|
|
|
📊 <b>Order Details:</b>
|
|
|
• Token: {token}
|
|
|
-• USDC Amount: {formatter.format_price_with_symbol(usdc_amount)}
|
|
|
-• Token Amount: {formatter.format_amount(token_amount, token)} {token}
|
|
|
+• USDC Amount: {await formatter.format_price_with_symbol(usdc_amount)}
|
|
|
+• Token Amount: {await formatter.format_amount(token_amount, token)} {token}
|
|
|
• Order Type: {order_type}
|
|
|
-• Price: {formatter.format_price_with_symbol(price, token)}
|
|
|
-• Current Price: {formatter.format_price_with_symbol(current_price, token)}
|
|
|
-• Est. Value: {formatter.format_price_with_symbol(token_amount * price)}"""
|
|
|
+• Price: {await formatter.format_price_with_symbol(price, token)}
|
|
|
+• Current Price: {await formatter.format_price_with_symbol(current_price, token)}
|
|
|
+• Est. Value: {await formatter.format_price_with_symbol(token_amount * price)}"""
|
|
|
|
|
|
if stop_loss_price:
|
|
|
confirmation_text += f"""
|
|
|
-• 🛑 Stop Loss: {formatter.format_price_with_symbol(stop_loss_price, token)}"""
|
|
|
+• 🛑 Stop Loss: {await formatter.format_price_with_symbol(stop_loss_price, token)}"""
|
|
|
|
|
|
confirmation_text += f"""
|
|
|
|
|
@@ -229,9 +229,9 @@ This will {"place a limit buy order" if limit_price else "execute a market buy o
|
|
|
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 order:\n"
|
|
|
- f"• Entry Price: {formatter.format_price_with_symbol(price, token)}\n"
|
|
|
- f"• Stop Loss: {formatter.format_price_with_symbol(stop_loss_price, token)} ❌\n\n"
|
|
|
- f"💡 Try a higher stop loss like: sl:{formatter.format_price(price * 1.05, token)}"
|
|
|
+ f"• Entry Price: {await formatter.format_price_with_symbol(price, token)}\n"
|
|
|
+ f"• Stop Loss: {await formatter.format_price_with_symbol(stop_loss_price, token)} ❌\n\n"
|
|
|
+ f"💡 Try a higher stop loss like: sl:{await formatter.format_price(price * 1.05, token)}"
|
|
|
))
|
|
|
return
|
|
|
|
|
@@ -242,16 +242,16 @@ This will {"place a limit buy order" if limit_price else "execute a market buy o
|
|
|
|
|
|
📊 <b>Order Details:</b>
|
|
|
• Token: {token}
|
|
|
-• USDC Amount: {formatter.format_price_with_symbol(usdc_amount)}
|
|
|
-• Token Amount: {formatter.format_amount(token_amount, token)} {token}
|
|
|
+• USDC Amount: {await formatter.format_price_with_symbol(usdc_amount)}
|
|
|
+• Token Amount: {await formatter.format_amount(token_amount, token)} {token}
|
|
|
• Order Type: {order_type}
|
|
|
-• Price: {formatter.format_price_with_symbol(price, token)}
|
|
|
-• Current Price: {formatter.format_price_with_symbol(current_price, token)}
|
|
|
-• Est. Value: {formatter.format_price_with_symbol(token_amount * price)}"""
|
|
|
+• Price: {await formatter.format_price_with_symbol(price, token)}
|
|
|
+• Current Price: {await formatter.format_price_with_symbol(current_price, token)}
|
|
|
+• Est. Value: {await formatter.format_price_with_symbol(token_amount * price)}"""
|
|
|
|
|
|
if stop_loss_price:
|
|
|
confirmation_text += f"""
|
|
|
-• 🛑 Stop Loss: {formatter.format_price_with_symbol(stop_loss_price, token)}"""
|
|
|
+• 🛑 Stop Loss: {await formatter.format_price_with_symbol(stop_loss_price, token)}"""
|
|
|
|
|
|
confirmation_text += f"""
|
|
|
|
|
@@ -332,15 +332,15 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
📊 <b>Position Details:</b>
|
|
|
• Token: {token}
|
|
|
• Position: {position_type}
|
|
|
-• Size: {formatter.format_amount(contracts, token)} 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)}
|
|
|
+• Size: {await formatter.format_amount(contracts, token)} contracts
|
|
|
+• Entry Price: {await formatter.format_price_with_symbol(entry_price, token)}
|
|
|
+• Current Price: {await formatter.format_price_with_symbol(current_price, token)}
|
|
|
+• {pnl_emoji} Unrealized P&L: {await formatter.format_price_with_symbol(unrealized_pnl)}
|
|
|
|
|
|
🎯 <b>Exit Order:</b>
|
|
|
• Action: {exit_side.upper()} (Close {position_type})
|
|
|
-• Amount: {formatter.format_amount(contracts, token)} {token}
|
|
|
-• Est. Value: ~{formatter.format_price_with_symbol(exit_value)}
|
|
|
+• Amount: {await formatter.format_amount(contracts, token)} {token}
|
|
|
+• Est. Value: ~{await formatter.format_price_with_symbol(exit_value)}
|
|
|
• Order Type: Market Order
|
|
|
|
|
|
⚠️ <b>Are you sure you want to close this {position_type} position?</b>
|
|
@@ -395,9 +395,9 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
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: {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"
|
|
|
+ f"• Entry Price: {await formatter.format_price_with_symbol(entry_price, token)}\n"
|
|
|
+ f"• Stop Price: {await formatter.format_price_with_symbol(stop_price, token)} ❌\n\n"
|
|
|
+ f"💡 Try a lower price like: /sl {token} {await formatter.format_price(entry_price * 0.95, token)}\n"
|
|
|
))
|
|
|
return
|
|
|
elif position_type == "SHORT" and stop_price <= entry_price:
|
|
@@ -405,9 +405,9 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
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: {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"
|
|
|
+ f"• Entry Price: {await formatter.format_price_with_symbol(entry_price, token)}\n"
|
|
|
+ f"• Stop Price: {await formatter.format_price_with_symbol(stop_price, token)} ❌\n\n"
|
|
|
+ f"�� Try a higher price like: /sl {token} {await formatter.format_price(entry_price * 1.05, token)}\n"
|
|
|
))
|
|
|
return
|
|
|
|
|
@@ -432,20 +432,20 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
📊 <b>Position Details:</b>
|
|
|
• Token: {token}
|
|
|
• Position: {position_type}
|
|
|
-• Size: {formatter.format_amount(contracts, token)} contracts
|
|
|
-• Entry Price: {formatter.format_price_with_symbol(entry_price, token)}
|
|
|
-• Current Price: {formatter.format_price_with_symbol(current_price, token)}
|
|
|
+• Size: {await formatter.format_amount(contracts, token)} contracts
|
|
|
+• Entry Price: {await formatter.format_price_with_symbol(entry_price, token)}
|
|
|
+• Current Price: {await formatter.format_price_with_symbol(current_price, token)}
|
|
|
|
|
|
🎯 <b>Stop Loss Order:</b>
|
|
|
-• Stop Price: {formatter.format_price_with_symbol(stop_price, token)}
|
|
|
+• Stop Price: {await formatter.format_price_with_symbol(stop_price, token)}
|
|
|
• Action: {exit_side.upper()} (Close {position_type})
|
|
|
-• Amount: {formatter.format_amount(contracts, token)} {token}
|
|
|
+• Amount: {await formatter.format_amount(contracts, token)} {token}
|
|
|
• Order Type: Limit Order
|
|
|
-• {pnl_emoji} Est. P&L: {formatter.format_price_with_symbol(pnl_at_stop)}
|
|
|
+• {pnl_emoji} Est. P&L: {await 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 {formatter.format_price_with_symbol(stop_price, token)} to protect your {position_type} position.
|
|
|
+This will place a limit {exit_side} order at {await formatter.format_price_with_symbol(stop_price, token)} to protect your {position_type} position.
|
|
|
"""
|
|
|
|
|
|
keyboard = [
|
|
@@ -499,9 +499,9 @@ This will place a limit {exit_side} order at {formatter.format_price_with_symbol
|
|
|
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: {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"
|
|
|
+ f"• Entry Price: {await formatter.format_price_with_symbol(entry_price, token)}\n"
|
|
|
+ f"• Take Profit: {await formatter.format_price_with_symbol(tp_price, token)} ❌\n\n"
|
|
|
+ f"💡 Try a higher price like: /tp {token} {await formatter.format_price(entry_price * 1.05, token)}\n"
|
|
|
))
|
|
|
return
|
|
|
elif position_type == "SHORT" and tp_price >= entry_price:
|
|
@@ -509,9 +509,9 @@ This will place a limit {exit_side} order at {formatter.format_price_with_symbol
|
|
|
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: {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"
|
|
|
+ f"• Entry Price: {await formatter.format_price_with_symbol(entry_price, token)}\n"
|
|
|
+ f"• Take Profit: {await formatter.format_price_with_symbol(tp_price, token)} ❌\n\n"
|
|
|
+ f"💡 Try a lower price like: /tp {token} {await formatter.format_price(entry_price * 0.95, token)}\n"
|
|
|
))
|
|
|
return
|
|
|
|
|
@@ -536,20 +536,20 @@ This will place a limit {exit_side} order at {formatter.format_price_with_symbol
|
|
|
📊 <b>Position Details:</b>
|
|
|
• Token: {token}
|
|
|
• Position: {position_type}
|
|
|
-• Size: {formatter.format_amount(contracts, token)} contracts
|
|
|
-• Entry Price: {formatter.format_price_with_symbol(entry_price, token)}
|
|
|
-• Current Price: {formatter.format_price_with_symbol(current_price, token)}
|
|
|
+• Size: {await formatter.format_amount(contracts, token)} contracts
|
|
|
+• Entry Price: {await formatter.format_price_with_symbol(entry_price, token)}
|
|
|
+• Current Price: {await formatter.format_price_with_symbol(current_price, token)}
|
|
|
|
|
|
🎯 <b>Take Profit Order:</b>
|
|
|
-• Target Price: {formatter.format_price_with_symbol(tp_price, token)}
|
|
|
+• Target Price: {await formatter.format_price_with_symbol(tp_price, token)}
|
|
|
• Action: {exit_side.upper()} (Close {position_type})
|
|
|
-• Amount: {formatter.format_amount(contracts, token)} {token}
|
|
|
+• Amount: {await formatter.format_amount(contracts, token)} {token}
|
|
|
• Order Type: Limit Order
|
|
|
-• {pnl_emoji} Est. P&L: {formatter.format_price_with_symbol(pnl_at_tp)}
|
|
|
+• {pnl_emoji} Est. P&L: {await 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 {formatter.format_price_with_symbol(tp_price, token)} to secure profit on your {position_type} position.
|
|
|
+This will place a limit {exit_side} order at {await formatter.format_price_with_symbol(tp_price, token)} to secure profit on your {position_type} position.
|
|
|
"""
|
|
|
|
|
|
keyboard = [
|