dougie80
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: February 15th, 2022
Contact: TradingView Profile

Creating a Strategy comment to webhook into 3Commas

Under the first strategy command I enter the comment:

21 strategy.entry(id="BUY", long=true)
22 comment="{\n\"message_type\": \"bot",\n\"bot_id\":

I then get an error message: line 22: no viable alternative at character '\'

Im a total newb can anyone tell me why this error is pooping up? thanks.

processingclouds
Pine Script Master
Pine Script Master
Posts: 115
Joined: January 30th, 2022

Re: Creating a Strategy comment to webhook into 3Commas

You need to put the comment inside the strategy function itself in order to use {{strategy.order.comment}}.

Also you are missing the escape \ before quotation close of bot.

Return to “Pine Script Q&A”