meghobrial
Pine Script Rookie
Pine Script Rookie
Posts: 2
Joined: March 2nd, 2022

Discord alerts

Hey everyone. I am new to this community. I have an indicator with standard alerts but I'm not sure how to modify it to allow for Discord alerts. can someone help please?

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

Re: Discord alerts

hEY,

1. Go to discord
2. Create a new channel where you want alerts (optional)
3. Edit Discord Settings
4. Click Integrations
5. Click New Webhook
6. Give it a name, and choose a channel
7. Copy the URL for webhook shown

8. Create a tradingView alert
9. Put check on webhook
10. Paste the URL (copied from discord)

11. Put your alert message in json format ( Discord likes that :) )

meghobrial
Pine Script Rookie
Pine Script Rookie
Posts: 2
Joined: March 2nd, 2022

Re: Discord alerts

yes this is the standard way but I got the 'Function call' alert types .. you can't use JSON format on that

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

Re: Discord alerts

Can you put the code, or part of the alert code, so i understand what Function Call you are talking about .?

mota
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: May 18th, 2023

Re: Discord alerts

hello guys I hope that you are all doing well, I have some troubles with sending alerts from my trading strategies to my discord,
I want to receive the following content from my trading strategies: ticker, exchange, time, strategy order, order price, take profit levels and stop loss levels, I tried to include many json formats in tradingview but I still couldn't figure it out.

for example: {"content": "{{ticker}} {{exchange}} {{timenow}} {{strategy.order.action}} {{strategy.order.price}}{{strategy.order.size}} {{strategy.order.alert_message}} {{plot(\"Short SL\")}} {{plot(\"Short TP\")}} {{plot(\"Long SL\")}} {{plot(\"Long TP\")}}" }

here's what I receive on discord: BTCBUSD BINANCE 2023-05-10T19:03:51Z buy 27601.79 Exit or Close BOT API for exiting SHORT positions. TP: {{valuewhen(strategy.position_size > 0, plot('Long TP'), 0)}} SL: {{valuewhen(strategy.position_size > 0, plot('Long SL'), 0)}}

I can't receive the order size, take profit levels and take loss levels. Can you please tell me what to include in tradingview message alerts to receive the proper output in my discord channels.

Thanks in advance guys

ccfos
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: January 27th, 2024

Re: Discord alerts

hello! i want the solution too if you have it. I have the same problem. i used the any alert() function

Return to “Share Your Scripts”