AliNotty
Pine Script Rookie
Pine Script Rookie
Posts: 3
Joined: September 11th, 2022
Contact: TradingView Profile

Inserting an input into an alert_messsge

Hi,

I have created an input for Long and Short 3Commas bot ID numbers. I would like to insert the bot ID number (which is "LongBotID") into the following (as indicated):

if (closeLongPosition)
strategy.close(id = 'Long Entry', alert_message = "{\n\"action\": \"close_at_market_price\",\n\"message_type\": \"bot\",\n\"bot_id\": LongBotID,\n\"email_token\": \"ac0cy3bb-582e-35b9-a771-9aa3c1342j434\",\n\"delay_seconds\": 0\n}")

The above doesn't work and I can't work out how to do it. Appreciate any assistance with this (if it is possible).

Kind regards,
Alistair

Return to “Pine Script Q&A”