Sunday 29 December 2019

How do I receive Tradingview alert Webhooks in Python

I'm trying to have alerts sent via webhook (TradingView's new feature) to a python program, and use them to make trades with Alpaca.

I tried using ngrok plus this script I found on Github:

https://github.com/Robswc/tradingview-webhooks-bot

After changing the port to 80 (no other port seems to work, I think this is on TradingView's end) I finally got something to come through:

127.0.0.1 - - [25/Dec/2019 21:26:45] code 400, message Bad request version ('À\x14À')
127.0.0.1 - - [25/Dec/2019 21:26:45] " Ì  ÈÁÄJÂ$/g{$¹¦HºÏE(·úå[:Ü´J÷ D+µ6ÑfYxºûáÙØkc`¸Ø­°ÜAzÜ  À/À0À+À,̨̩ÀÀ   ÀÀ" HTTPStatus.BAD_REQUEST -
127.0.0.1 - - [25/Dec/2019 21:26:51] code 400, message Bad request version ('À\x14À')
127.0.0.1 - - [25/Dec/2019 21:26:51] " Ì  ÈÃE¿¾GЪ6áe>ÃÝnI6MÚ3YÖ·¦7Ñ ïþG{äÉýCVÙA$ºÕ0ÒBô2õ+px¶  À/À0À+À,̨̩ÀÀ   ÀÀ[0m" HTTPStatus.BAD_REQUEST -
127.0.0.1 - - [25/Dec/2019 21:27:47] code 400, message Bad request version ('À\x14À')
4s"H  À/À0À+À,̨̩ÀÀ    ÀÀ" HTTPStatus.BAD_REQUEST -
127.0.0.1 - - [25/Dec/2019 21:27:52] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x00Ì\x01\x00\x00È\x03\x03\x92¯;H\x9c\x91ÁD7³\x04ʵù¶Óf\x9bzúÊä')
127.0.0.1 - - [25/Dec/2019 21:27:52] " Ì  ȯ;HÁD7³Êµù¶ÓfzúÊä Åïn@g" HTTPStatus.BAD_REQUEST -
127.0.0.1 - - [25/Dec/2019 21:27:58] code 400, message Bad request version ('À\x14À')
127.0.0.1 - - [25/Dec/2019 21:27:58] " Ì  ÈèÊh>Rd-«RN?Æ©Àh¯`á-õ¿  űE`²ÈìþW\y¼DÅî¿=9ÒüX  À/À0À+À,̨̩ÀÀ ÀÀ" HTTPStatus.BAD_REQUEST -
127.0.0.1 - - [25/Dec/2019 21:28:03] code 400, message Bad request version ('À\x14À')
127.0.0.1 - - [25/Dec/2019 21:28:03] " Ì  ȸêó^é:÷gPç©àóÛq}/p¬<ÉN ö3Ð<½w,øÒpa0&`¬[tý( »ÎV   À/À0À+À,̨̩ÀÀ  ÀÀ" HTTPStatus.BAD_REQUEST -

Anyone have any idea how to get this working? I'm just trying to send some json to the webhook on my local machine, then I can use Alpaca functions to make trades with it. Thanks in advance for any advice you can provide, and please let me know any information that can help further solve this, and I will gladly add it.



from How do I receive Tradingview alert Webhooks in Python

No comments:

Post a Comment