Skip to main content

Tradingview IMAP

With the Gunbot Tradingview addon, you can also use the IMAP listener, for example if using Webhooks is not an option for you (due to not having a static IP address, etc)

The IMAP Listener connects to your Email account and listens for incoming Emails from Tradingview. Then once an email from an Alert you've set up on Tradingview has been received, Gunbot will read these email contents and execute trades based on the message.

Configuring the IMAP Listener

Click on the 3 dots in the header and then on Tradingview alerts

Then you'll have to gather the following information:

ParameterDescription
EnabledTrue or False, to enable the listener or not
UserThe Email Address
PasswordPassword to login to the email account
HostThe IMAP Host of your Email
PortThe IMAP port of your Email Host
TLSIf TLS encyption should be used or not
Authorized fromsDefines a list of email addresses Gunbot is allowed to open and read emails.

User

The email address to use here is generally the same you're using with your tradingview.com account. If this is an email you use for everything else too, like personal emails and so on, it is suggested to change your email on tradingview.com to an entirely new one from Gmail.com You would use this email address only for logging into Tradingview.com and in Gunbot so it can parse the incoming email alerts.

You can change your Email address on Tradingview.com by logging into your account, then click on your profile image on the top right, then select Profile settings

And then click on Change Email

Then save your settings. This email will be for the User field in Gunbot.

Password

Assuming you've used Gmail as suggested, you cannot use the password you're using to login to your Gmail account here. Google enforces that you create an App Password.

To do so, you can follow this guide from Google to create one.

note

You'll have to secure your Gmail account with 2FA for App Passwords to become available

In the Select app field select Other and then give it any name to make it recognisable to you

Then press on Generate

Gmail will show you then the App Password to use in Gunbot for Password. This App Password is only shown once, so make sure you save it somewhere safe and delete it after you've finished the configuration.

Copy and paste this app password into the Password field in Gunbot, with the spaces between all 4 letters.

Host

The host can be left as is if you're using Gmail. In case you're using a different Email provider you'll have to look up the specific imap host address with this provider.

Port

Same applies here, can be left as is for Gmail, possibly must be changed to a different port depending on your email provider.

TLS

Leave this to true, unless you use your own email server and don't have a valid certificate. Defines if TLS encryption is used for the IMAP connection.

Authorized froms

The default in Gunbot is ["noreply@tradingview.com"], which is the email Tradingview.com sends their alerts from to your Email Address. However, if you wish to use more emails that Gunbot should read, use ["noreply@tradingview.com","anotherEmailToTrack@thisEmail.com"].

Save everything

After you've done everything above, hit save changes and apply.

If all was correctly done, you'll see this in your console:

Loading exchange - bybit
Loading exchange - binance
Loading data....
------------------------------------------------------------------------------------------------
ɢƱͶ฿๏Ł TradingView Edition v23- Waiting for alerts...2022/04/03 18:20:59
------------------------------------------------------------------------------------------------
Waiting for alerts...
Waiting for alerts...
Waiting for alerts...

Gunbot now waits for the first Email with an Alert to arrive and execute.