OpenAlgo TradingView automation works in three steps: OpenAlgo generates a JSON alert message for your symbol, you paste that message into a TradingView strategy alert, and you point the alert’s webhook URL at your OpenAlgo server. Every time the strategy fires a buy or sell signal, TradingView sends the webhook and OpenAlgo places the order with your broker, with no code to write.
For traders seeking to automate their strategies, OpenAlgo and TradingView offer a powerful combination. OpenAlgo is an open-source algo-trading platform allowing seamless integration with various brokers and charting tools, including TradingView. By connecting these platforms, you can execute your TradingView strategies automatically without writing any code!

Key Takeaways
- You need OpenAlgo running, a public HTTPS URL for it (for example via Ngrok with a custom domain) and a TradingView strategy.
- TradingView only allows webhook alerts when two-factor authentication is enabled on your account, and it accepts webhook URLs on ports 80 and 443 only.
- The JSON message from OpenAlgo carries the order details and your API key, so treat it like a password.
- Test in OpenAlgo’s Analyzer mode before sending live orders.
- Under SEBI’s retail algo framework, API orders must come from a static IP whitelisted with your broker.
OpenAlgo TradingView Automation: Step-by-Step Guide
Here’s a step-by-step guide to get you started:
Prerequisites
- OpenAlgo: Ensure you have OpenAlgo installed in a Python environment (preferably Python 3.10 or higher). Update: current OpenAlgo releases require Python 3.12 or later, as per the OpenAlgo documentation.
- Ngrok: Install and configure Ngrok with a custom domain for secure communication between platforms.
- .env File: Set up your .env file with the Ngrok custom domain and other necessary configurations.
Step 1: Start OpenAlgo and Log In
- Launch the OpenAlgo application.
- Open a web browser and navigate to the OpenAlgo host URL (typically http://127.0.0.1:5000/).
- Log in using your OpenAlgo credentials.

Step 2: Choose Your Broker
- Upon successful login, you’ll be presented with a list of supported brokers. Select your preferred broker and complete the necessary authentication steps.
Step 3: Download Master Contract and Access TradingView Tab
- Wait for the master contract to download successfully. This contract facilitates communication between OpenAlgo and your broker.
- Once downloaded, navigate to the “Tradingview” tab within the OpenAlgo interface.
Step 4: Generate TradingView JSON Message
- In the TradingView JSON Generator section, enter the OpenAlgo trading symbol for the instrument you want to trade.
- Select the appropriate exchange and product type (e.g., MIS, CNC).
- Click “Generate JSON” to create the message your TradingView strategy will send to OpenAlgo.
- Copy the generated JSON message.

Step 5: Create a TradingView Alert
- In TradingView, open the chart with the strategy you wish to automate.
- Access the “Indicators & Strategies” menu and select your chosen strategy.
- Click on the three dots next to the strategy name and choose “Add alert on…”.
- Select the strategy name as the condition for the alert.
- In the “Alert message” box, paste the JSON message you copied from OpenAlgo.

- Optionally, you can configure the alert with a specific expiration date or choose to trigger it “Every Time” the condition is met.
- Under “Notifications,” select “Webhook URL” and paste the TradingView Webhook URL provided by OpenAlgo. This URL directs the alert message to the OpenAlgo platform. TradingView shows the webhook option only when two-factor authentication is enabled on your account, and it rejects URLs on ports other than 80 and 443.
- Click “Create” to finalize your alert setup.

Step 6 (Optional): Configure Trading Quantity
- If your strategy requires a specific trade quantity, return to the “Indicators & Strategies” menu in TradingView.
- Right-click on your strategy and choose “Properties.”
- Adjust the “Order size” parameter to your desired quantity.
- Click “OK” to save the changes.

That’s it! You’ve successfully connected your TradingView strategy to OpenAlgo for automated trading. Now, whenever your strategy generates a buy or sell signal, the corresponding order will be automatically placed through your chosen broker. Remember, OpenAlgo’s open-source nature empowers you to explore, modify, and customize the platform to suit your specific trading needs.
Troubleshooting: Alert Fired but No Order Was Placed
Most failed automations come down to a handful of causes. Check these in order:
- Is OpenAlgo running and reachable? If your computer slept or Ngrok stopped, TradingView has nowhere to deliver the webhook.
- Is the broker session active? Most Indian brokers expire API sessions daily, so log in to OpenAlgo with your broker each trading day.
- Is the webhook URL correct? It must be the public HTTPS URL, not http://127.0.0.1:5000, which TradingView cannot reach.
- Was the master contract downloaded? Without it, OpenAlgo cannot map the symbol to your broker’s instrument.
- Is the symbol in OpenAlgo format? Generate the JSON from OpenAlgo rather than typing it by hand.
- Did the server respond in time? TradingView cancels a webhook request if the server takes longer than three seconds to respond (TradingView help).
- Is your IP whitelisted? SEBI’s retail algo framework applies to all brokers from 1 April 2026 (SEBI circular), and brokers reject API orders from a non-whitelisted IP. See how to get a static IP in India for algo trading compliance.
Best Practices Before Going Live
- Run the strategy in OpenAlgo’s Analyzer mode first and compare the logged orders with TradingView’s strategy tester.
- Start with the minimum quantity and increase it only after a few clean live sessions.
- Keep your JSON message and API key private. Anyone with them can send orders to your account.
- Set the alert to trigger “Every Time” for strategies, so every entry and exit reaches OpenAlgo.
- Review SEBI’s retail algo trading compliance checklist so your setup stays compliant.
Not sure whether this workflow suits you? Read who should use OpenAlgo. Dhan users can also look at this broker-specific Dhan TradingView webhook automation module.
For more video walkthroughs, visit the OpenAlgo YouTube channel.
Frequently Asked Questions
Can TradingView place orders automatically in India?
TradingView itself only sends alerts. A bridge such as OpenAlgo receives the webhook and places the order through your broker’s API, which makes the automation work with Indian brokers.
Do TradingView webhooks need two-factor authentication?
Yes. TradingView allows webhook alerts only when two-factor authentication is enabled on your account.
Why do I need Ngrok for OpenAlgo?
TradingView sends webhooks over the internet, so it needs a public HTTPS address. Ngrok gives your locally running OpenAlgo a public URL without opening ports on your router. A VPS with its own domain works too.
Is OpenAlgo free?
Yes. OpenAlgo is open source and free to self-host. You pay only for hosting (if any) and your broker charges.
Learn by watching: free videos every week
Market Profile, order flow, Python, AI and OpenAlgo tutorials on YouTube.

