robswc / tradingview-webhooks-bot

a framework 🏗 for trading with tradingview webhooks!
http://tvwb.robswc.me
GNU General Public License v3.0
603 stars 182 forks source link

403 FORBIDDEN #8

Open rgbnhtrfcxs opened 4 years ago

rgbnhtrfcxs commented 4 years ago

Im getting the 403 message, Im not sure what to do.

hatzkel commented 4 years ago

If you are on Bitmex make sure the API key is order instead of "order cancel" which means cancel only.

robswc commented 4 years ago

hey, were you able to find the solution to this? what address did you get the error on?

esturilio commented 4 years ago

Potential issues here:

A) PIN CODE Maybe you have just copied/pasted the example alert message template?

This may be due to the verification hash generated from the PIN code in https://github.com/Robswc/tradingview-webhooks-bot/blob/079f50343fe77bbd03cb8f62fc04e332d3a08395/tradingview-webhooks-bot/auth.py#L14

Suggestion:

  1. enter your own PIN to generate your own hash in auth.py
  2. move generate_alert_message.py to main folder
  3. execute generate_alert_message.py to generate the template alert message
  4. paste the generated template message on TV (this one contains your hashed key)

B) HOOKING

Another thing is: using the generated template will make TV send the POST as JSON. If you're not hooking via ngrok, line 30 won't work. You have to:

1) add the following on the import section of webhook-bot.py: import json

2) change https://github.com/Robswc/tradingview-webhooks-bot/blob/079f50343fe77bbd03cb8f62fc04e332d3a08395/tradingview-webhooks-bot/webhook-bot.py#L30

to: data = json.loads(request.data,encoding='utf-8')

alperoguz commented 3 years ago

Hello @esturilio I don't use ngrok and when the alert received from Tradingview, webhooks continuously giving http 405.

I entered an unique key to PIN, not from Bitmex secret etc. And ran generate_alert_message.py, got the line like below. I copied this line into TV alert message box. Is this correct?

{"type": "market", "side": "buy", "amount": "500", "symbol": "XBTUSD", "price": "None", "key": "90fca5b............"}

Also, I am not sure that understand your B) part. I only replaced 30th line with below, but problem persist.

data = json.loads(request.data,encoding='utf-8')

thanks

minimalist15 commented 2 years ago

i have the same problem as i dont get an output with they to use