Automated Supertrend Trading with Zerodha + AlgoMojo + TradingView

Zerodha’s built-in TradingView charts inside Kite look advanced, but they cannot create alerts, webhooks, or JSON outputs. Therefore, automated trading using Supertrend or any custom logic must be done through:

TradingView.com web platform
AlgoMojo Webhook
Zerodha API for order execution

This guide explains how to automate the powerful Supertrend + EMA 50 trend confirmation system using only built-in TradingView indicators.


⭐ Why Supertrend + EMA50 Works

The combination avoids false signals:

  • Supertrend decides the Buy/Sell direction

  • EMA 50 acts as trend filter

    • Buy only if price above EMA 50

    • Exit or avoid buy if price below EMA 50

    • Sell/Exit only if Supertrend flips down

This makes entries cleaner and avoids chop.


⭐ Automation Flow

TradingView Alert → AlgoMojo Webhook → Zerodha Order

This is the only automation path for Zerodha.


🔥 Step-by-Step Setup


STEP 1 — Open TradingView.com (not Zerodha charts)

Because Zerodha charts cannot create alerts:

❌ No alerts
❌ No webhooks
❌ No JSON
❌ No automation

TradingView.com supports all features required.


STEP 2 — Add Built-in Supertrend (TradingView)

  1. Indicators

  2. Search Supertrend

  3. Select Supertrend (by TradingView)

You now have Supertrend Up/Down signals.


STEP 3 — Add Built-in EMA 50

  1. Indicators

  2. Search Moving Average

  3. Add

  4. Set Length = 50

  5. Set Source = Close

EMA 50 now appears on chart.


How Signals Will Work

BUY Conditions

  • Supertrend flips UP

  • Price above EMA 50

  • Send BUY order via AlgoMojo → Zerodha

EXIT Conditions

  • Supertrend flips DOWN
    OR

  • Price closes below EMA 50

This gives cleaner trend trades.


⭐ STEP 4 — Create TradingView Alert

Click the Alert (clock icon) and choose:

  • Condition: Supertrend

  • Trigger: Supertrend Up / Supertrend Down

  • Once Per Bar Close

  • Check Webhook URL → Paste AlgoMojo webhook

  • Message → Paste the JSON below


⭐ COMBINED BUY + EXIT JSON (Supertrend + EMA50 Confirmation)

This JSON makes AlgoMojo place:

  • BUY when → Supertrend Up AND price > EMA 50

  • EXIT when → Supertrend Down OR price < EMA 50

Perfect for Zerodha automation.

{ "strategy": "supertrend_ema50", "symbol": "{{ticker}}", "signal": "{{#if (and (eq(alert.condition,'Supertrend Up') ) (gt(close, ema50)) ) }}BUY{{else}}EXIT{{/if}}", "quantity": "1", "order_type": "MARKET", "product": "MIS", "exchange": "NFO" }

⭐ NSE Stock Version (CNC)

{ "strategy": "supertrend_ema50", "symbol": "{{ticker}}", "signal": "{{#if (and (eq(alert.condition,'Supertrend Up') ) (gt(close, ema50)) ) }}BUY{{else}}EXIT{{/if}}", "quantity": "10", "order_type": "MARKET", "product": "CNC", "exchange": "NSE" }

⭐ Version with Stoploss + Target

{ "strategy": "supertrend_ema50", "symbol": "{{ticker}}", "signal": "{{#if (and (eq(alert.condition,'Supertrend Up') ) (gt(close, ema50)) ) }}BUY{{else}}EXIT{{/if}}", "quantity": "1", "order_type": "MARKET", "product": "MIS", "exchange": "NFO", "stoploss": "40", "target": "80" }

💡 Tips for Best Accuracy

  • Use 5-min or 15-min timeframes

  • Use SL orders or MIS product for safety

  • Avoid automation during major events

  • Use One alert per symbol for clean execution


🚀 Final Summary

FeatureSupported
Built-in Supertrend
EMA 50 trend filter
Supertrend + EMA50 combo
Combined Buy + Exit JSON
AlgoMojo → Zerodha
No Pine Script
Works with stocks + futures

You now have a complete automated trend-following system using only built-in TradingView indicators.

Comments

Popular posts from this blog

OVERSOLD BY LINEAR REGRESSION

OVERSOLD BY LINEAR REGRESSION

Top No-Code Algo Trading Platforms in India (2025) – Full Comparison & Ranking