I just created an indicator and also backtested it using strategy tester. Now I wish to run it automated with a 3rd party application. How can i add their webhook url in alert programmatically? any code snippets would be amazing!! I am new to pinescript
2 Answers
This is not possible. You can only configure the alert message programmatically not the webhook URL.

- 15,740
- 3
- 16
- 26
-
in that case, can i set alert manually and then later trigger them programmatically based on a condition i put in the code (and include a message while triggering)? – user20537640 Nov 22 '22 at 07:22
-
No. As soon as you create an alert, a snapshot of your chart will be saved it will run on the server. Any changes you make after that won't be affecting your existing alert configuration. – vitruvius Nov 22 '22 at 09:15
-
Man!! then how do people do algotrading using the script they built on pinescript? Is there some other piece of puzzle i am missing here? – user20537640 Nov 22 '22 at 12:58
-
Why do you want to add the webhook programmatically? What's the issue with using the alert dialog box? – vitruvius Nov 22 '22 at 13:23
-
because not all brokers are supported by tradingview so in order to send information to another website, I need webhooks. BTW even in tradingview listed brokers (interactive brokers, etc.), how can I execute buy/sell/TP/SL with pinescript?? couldn't figure out where to find guidance for it :(( – user20537640 Nov 22 '22 at 17:11
-
I still don't get it. You can place the webhook link via the alert message dialog box. What's the difference if you do it there or via the script? Automated trading is not supported by Tradingview/Pinescript. You can trade manually with the listed ones. – vitruvius Nov 22 '22 at 20:21
you can not add url in scrip of tv
if you want to do algo trading there is a way to do it ~>
bro if you have subscription of tv
1st create broker api and secret key copy it 2nd paste api and secreat key in 3party application bot then bot give you a url copy it .
3st create a alert based on condition and write messages what you want to send
to bot so he understand it when to buy/sell order
application so that bot can understand
4nd paste url in alert action menu in webhook box
5th As alert triger send message to bot . bot exicute order on broker or
exchange
if you dont have a subscription plan it has difficult to do it
there is other way to do it it will different
1st open a website https://pipedream.com/@/new/build this link create a work flow
in triger use email as a triger copy email
1st create a alert in alert there is a alert option email to sms click on that
paste here and verify emai otp send to pipedream workflow `~> body in text
2nd click on + button of workflow send http post request and paste bot url there
3rd message send to bot by pipedream and bot will exicute order