Connecting TradingView Alerts directly to your Hoox edge gateway is the most common way to automate your trading strategies. By combining TradingView’s advanced charting engines with Hoox’s low-latency edge execution, you can trigger orders instantly based on mathematical indicators, chart patterns, or custom Pine Script v5 logic.
This tutorial walks you through writing a Pine Script v5 script, setting up a TradingView webhook alert, and testing executions.
💻 Step 1: Writing a Pine Script v5 Signal Indicator
To trigger clean trade alerts, use TradingView’s Pine Script v5. Below is a copy-paste indicator script that evaluates a Moving Average Cross strategy and generates standardized trade alert signals:
Replace "your-hoox-webhook-passkey" in your Pine Script with the actual
passkey configured in your CONFIG_KV store (webhooks:api_key). This is a
critical security step—the gateway will reject any alerts with mismatched keys
with a 401 Unauthorized error.
🔔 Step 2: Creating the TradingView Webhook Alert
Once your script is saved and added to your chart:
- Click the Alarm Clock (Alerts) icon on the top right panel in TradingView.
- Select Condition: Choose your indicator
"Hoox EMA Cross Signals" and select "Any Alert Function Call" (this directs TradingView to parse the custom JSON payloads from the alert() functions inside your script).
- Under Expiration: Select your alert lifespan (Premium accounts support Open-Ended alerts).
- Navigate to the Notifications Tab:
- Check the Webhook URL box.
- Paste your public Hoox Gateway endpoint URL:
https://hoox.alpha-trading.workers.dev/webhook
- Navigate to the Settings Tab:
- In the Message box, type:
{{strategy.order.alert_message}} (if using a Backtesting Strategy) or leave it blank (if using an Indicator, as the JSON payload is already defined inside our alert() function).
- Click Create.
🔍 Step 3: Verifying Execution in Production
When the Moving Average crossover occurs on your chart:
- TradingView compiles the JSON payload and POSTs it to your edge gateway.
- The
hoox gateway validates the signature and routes the order to Bybit.
- Check the transaction directly in your terminal:
- Stream live gateway telemetry logs to verify execution latency:
🛠️ Webhook Troubleshooting Runbook
🔗 Next Steps