Automating TradingView Alerts with Nubra API Using Webhooks#
Build a fully automated TradingView -> Nubra trading bridge in minutes.
Live Demo#
In this demo:
- Left side: TradingView strategy
- Right side: Nubra account
- When the alert triggers -> order is placed instantly
Overview#
This guide walks you through setting up:
- TradingView alerts
- A lightweight webhook server
- A public HTTPS endpoint
- Automated order placement via Nubra API
You will learn how to connect:
TradingView -> Webhook -> Your Server -> Nubra API -> Order Execution
No complex setup required.
Architecture Overview#
The automation flow looks like this:
- A TradingView strategy generates a signal
- TradingView sends a webhook alert
- Your webhook server receives the payload
- Nubra API executes the order
Everything happens automatically once configured.
Step 1 - Start Your Webhook Server#
Your webhook server acts as the bridge between TradingView and Nubra.
It should:
- Receive webhook alerts
- Validate incoming data
- Connect to Nubra
- Execute orders when alerts trigger
Once running, confirm:
- Server is active
- Nubra login successful
- No authentication errors
Step 2 - Make Your Server Public#
TradingView requires a public HTTPS endpoint.
Localhost will not work directly.
Option A - Cloudflare Tunnel (Recommended)#
Cloudflare Tunnel creates a secure public URL without opening ports.
Steps:
- Start your local server
- Run Cloudflare tunnel
- Copy generated HTTPS URL
Example format:
https://random-name.trycloudflare.com
Your webhook endpoint becomes:
https://random-name.trycloudflare.com/webhook/tradingview
Option B - Other Alternatives#
You may also use:
- ngrok
- localtunnel
- VPS hosting
Step 3 - Prepare Your Pine Script Strategy#
Open TradingView.
You can:
- Use an existing strategy
- Or create a simple buy/sell strategy
Paste your Pine Script into:
TradingView -> Pine Editor
Click:
Add to Chart
Step 4 - Create TradingView Alert#
Now configure the automation trigger.
- Click Add Alert
- Select your strategy condition
- Enable Webhook URL
- Paste your public HTTPS endpoint
- Open the message field
- Paste your structured webhook payload
- Save the alert
Make sure:
- Alert triggers "Once per bar close"
- Webhook URL is HTTPS
- JSON message is properly formatted
Step 5 - Test the Setup#
When your strategy condition hits:
- TradingView sends webhook
- Server receives alert
- Nubra API executes order
- Order appears in Nubra account
If everything is configured correctly, the entire flow will happen automatically.
Common Things to Check#
If orders are not placing:
- Is server running?
- Is tunnel active?
- Is webhook URL correct?
- Is TradingView alert enabled?
- Is Nubra login successful?
- Is trading enabled in your environment config?
Important Notes#
- Webhook alerts require a paid TradingView plan
- 2FA must be enabled in TradingView
- Public URL must use HTTPS
- Server must respond within 3 seconds
Final Flow Recap#
You now have a complete automated trading bridge between TradingView and Nubra.
What's Next?#
You can extend this setup with:
- Multiple symbols
- Strategy IDs
- Risk management logic
- Position tracking
- Production hosting
- Monitoring and audit logs
Open-source sample project#
If you want a working reference instead of building everything from scratch, you can explore Nubra Webhooks, an open-source sample project for webhook-based Nubra V3 order placement.
The project includes a local webhook receiver, a Nubra V3 payload builder, Cloudflare Tunnel support for public webhook URLs, basic order history, and a simple UI for creating TradingView alert messages. You can use it as a starting point, study the flow, or customize it for your own webhook automation setup.
GitHub: https://github.com/socials-zanskar/nubra-webhooks
This is a reference implementation. Before using any webhook workflow with live orders, review authentication, quantity limits, risk controls, public URL setup, and order-status handling for your own use case.
Conclusion#
With a simple webhook server and a public HTTPS endpoint, you can transform TradingView alerts into fully automated Nubra trades.
This setup works for:
- Strategy testing
- Signal automation
- Algorithmic workflows
- Scalable trading systems
