To install the Python package dependencies you have to type pip install -r requirements.txt
into the command prompt which already cd into the project directory.
- A ngrok account.
- A pipedream account or any other workflow
- Docker Desktop (optional) - If you want to use the Docker version. automation service.
- Make a copy of the
config.example.toml
. - Rename the copied file to
config.toml
. - Open
config.toml
with any text editor you like. - Set
mode_traditional
tofalse
. - Copy your ngrok authtoken and fill in
ngrok_auth_token
. - Fill in
webhook_urls
with your webhook service URLs.
Note
It is a good idea to test your signal or the program using a webhook test service such as webhook.site instead of using your production webhook.
- Save the config file.
- Open the command prompt and cd into the project directory.
- Type
pip install -r requirements.txt
to install the Python package dependencies. - Type
python main.py
to start the program.
- Open the command prompt and cd into the project directory.
- Type
docker-compose build
to build the docker image. - Type
docker-compose up
to start the program. (You can close the command prompt after finishing next step.)
Warning
Your config.toml
will be copied directly into the docker image. Meaning that you WILL expose your secrets to the public if you push/share the docker image to the public/others. (You should not do that.)
Note
To view the program logs, simply click the name of the tradingview-free-webhook-alerts
container. (You have to do this to get the API KEY and ngrok URL.)
Note
You have to run the docker-compose build & docker-compose up
command if you updated the config.toml
.
- Copy the "API KEY" and "ngrok URL" from the command prompt and paste them somewhere for later use.
- Keep the program running in the background.
⚠️ Every time you start the program, you will get a new API KEY and ngrok URL. You need to update the webhook service with the new API KEY and ngrok URL.
Setting up pipedream
- Login to pipedream and create a new workflow.
- Select
New Emails
as the trigger.
- Copy the email address given by pipedream and paste it into the
Email-to-SMS
field in your TradingView account. (You can follow this instruction to change theEmail-to-SMS
email address.) - In order to find out the
Email-to-SMS
update verification code, you need to click the event dropdown menu below the given email address and select the verification email.
- Find your verification code under
steps.trigger -> event -> body -> text
and paste it back into theEmail-to-SMS
field. - Click the "Continue" button.
- Select
HTTP / Webhook
.
- Select
Send any HTTP Request
.
- Change the HTTP request method to
POST
. - Paste the ngrok URL into the "URL" field and add
/api
to the end of the URL.
- Add a new header field with the name
X-API-KEY
and paste the API KEY into the value field. - Go to the "Body" tab.
- Change the "Content Type" to
application/json
. - Copy and paste the following KEY and VALUE pairs.
KEY | VALUE |
---|---|
from |
{{steps.trigger.event.headers.from.value[0].address}} |
subject |
{{steps.trigger.event.headers.subject}} |
content |
{{steps.trigger.event.body.text}} |
receive_datetime |
{{steps.trigger.context.ts}} |
(order is not important)
- Click the "Test" button.
- If you see the message "Success", you can click the "Deploy" button.
- You are done! Now you can test your TradingView alert.
- An IMAP available email account (eg.Hotmail, Outlook, Gmail, etc.)
You must finish the following steps before using the program.
- Make a copy of the
config.example.toml
. - Rename the copied file to
config.toml
. - Open
config.toml
with any text editor you like. - Fill in
email_address
andlogin_password
with your email and password. - Fill in
imap_server_address
andimap_server_port
with your email server and port. (For example, if you are using Hotmail, it will beoutlook.office365.com
and993
, Gmail will beimap.gmail.com
and993
.) - Fill in
webhook_urls
with your webhook service URLs. - Save the config file.
You can adjust other settings on your own.
Note
It is a good idea to test your signal or the program using a webhook test service such as webhook.site instead of using your production webhook.
You must finish the following steps before using the program.
- Enable
2-Step Verification
on your Gmail account. - Create an App Password for the program to use. (Please read through this article for more information.) It is recommended to choose
Other (Custom name)
as the app in order to make it easier to identify in the future. - Fill in
email_address
andlogin_password
with your email and the app password. - Enable IMAP in your email account. (Please read through this article for more information.)
You are good to go!
- Enable IMAP in your email account.
- Create a new alert as usual. (Fill in the
Condition
,Options
andExpiration time
fields.) - Enable
Send email-to-SMS
/Send email
and other action you want inAlert actions
. If you want another email address that is different from your TradingView account, you should enableSend email-to-SMS
instead ofSend email
. - Fill in the
Alert name
and your webhook message inMessage
. - Save the alert.
- Open the command prompt and cd into the project directory.
- Run
python main.py
in the command prompt.
- Open the Docker Desktop
- Click to the "Containers" tab.
- Click the "Run" button. (Inside the "Actions" column)
Warning
If you are using ngrok version (Local / Docker), you will get a new API KEY and ngrok URL every time you start the program. You need to update the webhook service with the new API KEY and ngrok URL.