fabston / TradingView-Webhook-Bot

πŸ“Š Send TradingView alerts to Telegram, Discord, Slack, Twitter and Email.
MIT License
1.25k stars 392 forks source link

connecting to ip #33

Closed ethhhhh closed 3 years ago

ethhhhh commented 3 years ago

Hi when i attempt to connect my ip to the webhook url i get the error of "the host is not allowed".

fabston commented 3 years ago

Hi,

You probably run the script as a non root user. Since Flask binds it on port 80/443 root privileges are required.

Either you chose to run it as root; forward port 80 to something like 8080; or you run it behind Apache / Nginx. Easiest solution is the first one, but not recommended.

ethhhhh commented 3 years ago

Hey so I have my public ip connected to the weebhook url in trading view. I have a webhook setup in my discord server. I have appended the discord we hook into config.py is this correct?

On Thu, Feb 4, 2021 at 11:56 AM Visionz notifications@github.com wrote:

Hi,

You probably run the script as a non root user. Since Flask binds it on port 80/443 root privileges are required.

Either you chose to run it as root; forward port 80 to something like 8080; or you run it behind Apache / Nginx. Easiest solution is the first one, but not recommended.

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vsnz/TradingView-Webhook-Bot/issues/33#issuecomment-773531455, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASXKERF7YTRFSPRF5NQBY3LS5LUUBANCNFSM4XDKWP4A .

fabston commented 3 years ago

It sounds correct however running it from your local machine can be a little struggle since you most likely have to open ports too.

ethhhhh commented 3 years ago

Thanks for the reply. When I run python main.py i get:

Serving on http://0.0.0.0:80

When it’s running alerts are not sent to discord. Does this mean I need to change my port. I can send the config.py file if needed.

Thanks for your help.

On Thu, Feb 4, 2021 at 12:40 PM Visionz notifications@github.com wrote:

It sounds correct however running it from your local machine can be a little struggle since you most likely have to open ports too.

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vsnz/TradingView-Webhook-Bot/issues/33#issuecomment-773557129, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASXKERAAJT3HAQYZ746Q67DS5LZ4FANCNFSM4XDKWP4A .

fabston commented 3 years ago

Serving on 0.0.0.0 is just your local IP. You'd have to use your external IP in TV's Alerts message. You can find that out by typing ifconfig in your terminal, if your on Linux.

ethhhhh commented 3 years ago

Hey, I have copied and pasted my config.py file. I'm using university wifi, could this be causing the issues? What is the desired output after entering python -main.py. Thanks for the help. I'm new to programming.

-----------------------------------------------

Plugin Name : TradingView-Webhook-Bot

Author Name : vsnz

File Name : config.py

-----------------------------------------------

TradingView Example Alert Message:

{"key": "9T2q394M92", "telegram": "-1001298977502", "discord":

"789842349670960670/BFeBBrCt-w2Z9RJ2wlH6TWUjM5bJuC29aJaJ5OQv9sE6zCKY_AlOxxFwRURkgEl852s3","msg": "Long #{{ticker}} at {{close}}"}

sec_key = "$$" # Can be anything. Has to match with "key" in your TradingView alert message

Telegram Settings

send_telegram_alerts = False

tg_token = '' # Bot token. Get it from @Botfather

channel = 0 # Channel ID (ex. -1001487568087)

Discord Settings

send_discord_alerts = True

discord_webhook = ' https://discord.com/api/webhooks/806929289547218984/9cltAyX2DCw08ElIIZRyhIqg-48C7yeeqQpU2Fkef99Lyk5UKZNTVtzkz_01Q3kE0L1n '

this is the webhook i created in a discord channel

# https://discord.com/api/webhooks/806929289547218984/9cltAyX2DCw08ElIIZRyhIqg-48C7yeeqQpU2Fkef99Lyk5UKZNTVtzkz_01Q3kE0L1n

Discord Webhook URL (

https://support.discordapp.com/hc/de/articles/228383668-Webhooks-verwenden)

{"key": "$$", "disord": "not sure what to place here ", "msg": "Ticker

{{ticker}} at {{close}}"}

Twitter Settings

send_twitter_alerts = False

tw_ckey = ''

tw_csecret = ''

tw_atoken = ''

tw_asecret = ''

Email Settings

send_email_alerts = True

email_sender = '' # Your email address

email_receivers = ['', ''] # Receivers, can be multiple

email_subject = 'Trade Alert!'

email_port = 465 # SMTP SSL Port (ex. 465)

email_host = '' # SMTP host (ex. smtp.gmail.com)

email_user = '' # SMTP Login credentials

email_password = '' # SMTP Login credentials

On Thu, Feb 4, 2021 at 1:21 PM Visionz notifications@github.com wrote:

Serving on 0.0.0.0 is just your local IP. You'd have to use your external IP in TV's Alerts message. You can find that out by typing ifconfig in your terminal, if your on Linux.

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vsnz/TradingView-Webhook-Bot/issues/33#issuecomment-773580054, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASXKERDV7G7W7GLLKQBT5Y3S5L6T5ANCNFSM4XDKWP4A .

fabston commented 3 years ago

A desired output would be what you said, serving at 0.0.0.0:80.

Config looks fine. As long as you use the same key ($$) in your TV Alerts. However even if not the terminal will print the rejection. Hosting it from a home sever is always tricky and iffy. Would not advice to do it.

Alternatively I'm offering a service which also supports the attachment of Chart Screenshots. Maybe your interested. TV-Alerts.com.

ethhhhh commented 3 years ago

Hey Im not sure were to find the key in my tradingview alerts

On Thu, Feb 4, 2021 at 2:59 PM Visionz notifications@github.com wrote:

A desired output would be what you said, serving at 0.0.0.0:80.

Config looks fine. As long as you use the same key ($$) in your TV Alerts. However even if not the terminal will print the rejection. Hosting it from a home sever is always tricky and iffy. Would not advice to do it.

Alternatively I'm offering a service which also supports the attachment of Chart Screenshots. Maybe your interested. TV-Alerts.com https://tv-alerts.com.

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vsnz/TradingView-Webhook-Bot/issues/33#issuecomment-773631087, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASXKERF6EJGGVFWE66ERMQ3S5MKFNANCNFSM4XDKWP4A .

fabston commented 3 years ago

Has been explained in the installation guide point 6.

ethhhhh commented 3 years ago

what are my other options either then hosting on a home server?

On Thu, Feb 4, 2021 at 3:07 PM Visionz notifications@github.com wrote:

Has been explained in the installation guide https://github.com/vsnz/TradingView-Webhook-Bot#installation point 6.

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vsnz/TradingView-Webhook-Bot/issues/33#issuecomment-773634739, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASXKERCVUT6UVGUWGK46CATS5MLCBANCNFSM4XDKWP4A .

fabston commented 3 years ago

Hosting it on a VPS as mentioned in the Readme. Will cost you ~$4/mo depending on the service you choose.

elbrujjo commented 3 years ago

Yo man wich vps is that,sorry

On Thu, Feb 4, 2021, 5:16 PM Visionz notifications@github.com wrote:

Hosting it on a VPS as mentioned in the Readme. Will cost you ~$4/mo depending on the service you choose.

β€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vsnz/TradingView-Webhook-Bot/issues/33#issuecomment-773639269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMIKZSNIMY3QWU7DJC76SN3S5MMFBANCNFSM4XDKWP4A .

fabston commented 3 years ago

I am using Hetzner. (Use my ref link and get 20€ free credits)

elbrujjo commented 3 years ago

Sure thank you!

On Fri, Feb 5, 2021, 12:09 AM Visionz notifications@github.com wrote:

I am using Hetzner https://vsnz.net/hetzner. (Use my ref link and get 20€ free credits)

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vsnz/TradingView-Webhook-Bot/issues/33#issuecomment-773792120, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMIKZSOPEAI6WKCCDYTUQDLS5N4RPANCNFSM4XDKWP4A .