Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

How to Send Automated Orders from Tradingview to Algomojo Platform

3 min read

This tutorial explores how to send automated orders from Tradingview using webhook method to Algomojo Trading Platform.

Tradingview Webhooks are often used to trigger automated trades, send notifications to different platforms (like messaging apps or email), or interact with other financial tools and services. For instance, you could set up a webhook to notify you via a messaging app when a certain stock reaches a target price.

If you are very new to the Algomojo Platform then kickstart with this tutorial

How to Send Automated Option Orders Tutorial

TradingView Webhook

Tradingview Webhooks allows you to send a POST request to a certain URL every time the alert is triggered. This feature can be enabled when you create or edit an alert

Various Modes One can send Alerts from Tradingview Platform

1)Horizontal Line Trigger Alerts
2)Price Crossover Alerts
3)Trendline/Channel Alerts
4)Custom Indicator/Strategy Alerts
5)Tradingview Screener Alerts

Free Version or Paid Version in Tradingview?

Both free version and paid version supports Realtime data for NSE Cash, NSE Futures, MCX Futures with Alerts. However Webhook Alerts are available in Tradingview Pro version onwards.

Trading View Alert Configuration

Here are the different webhook configuration settings for various type of orders. Note for bracket orders one need to send along with token id. Which will be discussed in the upcoming articles.

Webhook URL for placing orders (MKT, LMT, SL, SL-LMT, CO,AMO orders)

Broker - Aliceblue 
https://abapi.algomojo.com/1.0/PlaceOrder 

Broker - Tradejini
https://tjapi.algomojo.com/1.0/PlaceOrder 

Broker - Zebu
https://zbapi.algomojo.com/1.0/PlaceOrder

Webhook Message FormatSample Placeorder Example

{
    "api_key":"c1997d92a3bb556a67dxxxx1446b7087",
    "api_secret":"5306433329e81ba4dfsdfs653417063c71",
    "data":
      {
        "strg_name":"Tradingview Alerts",
        "s_prdt_ali":"BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML",
        "Tsym":"RELIANCE-EQ",
        "exch":"NSE",
        "Ttranstype":"B",
        "Ret":"DAY",
        "prctyp":"MKT",
        "qty":"1",
        "discqty":"0",
        "MktPro":"NA",
        "Price":"0",
        "TrigPrice":"0",
        "Pcode":"MIS",
        "AMO":"NO"
      }
}

Webhook URL for placing Bracket Orders

Broker - Aliceblue
https://abapi.algomojo.com/1.0/PlaceBOOrder 

Broker - Tradejini
https://tjapi.algomojo.com/1.0/PlaceBOOrder 

Broker - Zebu
https://zbapi.algomojo.com/1.0/PlaceBOOrder

Webhook Message FormatSample Bracketorder Example

Request example :

{
  "api_key":"c1997d92a3bb556a67dca7d1446b70",
  "api_secret":"5306433329e81ba41203653417063c",
  "data":
    {
      "strg_name": "Bracket Order Strategy",
      "s_prdt_ali":"BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML",
      "TokenNo":"317",
      "exch":"NSE",
      "Ttranstype":"B",
      "Ret":"DAY",
      "qty":"0",
      "discqty":"0",
      "Price":"0",
      "ltpOratp":"NA",
      "SqrOffAbsOrticks":"Ticks",
      "SqrOffvalue":"1",
      "SLAbsOrticks":"Ticks",
      "SLvalue":"1",
      "trailingSL":"0",
      "tSLticks":"1"
    }
}

Webhook URL for placing Multi Client/Basket orders

Broker - Aliceblue
https://abapi.algomojo.com/1.0/PlaceMultiOrder 

Broker - Tradejini
https://tjapi.algomojo.com/1.0/PlaceMultiOrder 

Broker - Zebu
https://zbapi.algomojo.com/1.0/PlaceMultiOrder

Webhook Message FormatSample Multiorder Example

{
    "api_key":"c1997d92a3bb556a67dca7d1446b70",
    "api_secret":"5306433329e81ba41203653417063c",
    "data":
      {
          "orders" : 
            [
                {
                "order_refno":"1",
                "user_apikey":"c1997d92a3bb556a67dca7d1446b70",
                "api_secret":"5306433329e81ba41203653417063c",
                "strg_name": "Test Strategy",
                "s_prdt_ali":"BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML",
                "Tsym":"RELIANCE-EQ",
                "exch":"NSE",
                "Ttranstype":"B",
                "Ret":"DAY",
                "prctyp":"MKT",
                "qty":"1",
                "discqty":"0",
                "MktPro":"NA",
                "Price":"0",
                "TrigPrice":"0",
                "Pcode":"CNC",
                "AMO":"NO"
                },
                {
                "order_refno":"2",
                "strg_name": "Test Strategy",
                "user_apikey":"c1997d92a3bb556a67dca7d1446b70",
                "api_secret":"5306433329e81ba41203653417063c",
                "s_prdt_ali":"BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML",
                "Tsym":"INFY-EQ",
                "exch":"NSE",
                "Ttranstype":"B",
                "Ret":"DAY",
                "prctyp":"MKT",
                "qty":"0",
                "discqty":"0",
                "MktPro":"NA",
                "Price":"0",
                "TrigPrice":"0",
                "Pcode":"CNC",
                "AMO":"NO"
                }
            ]
      }
}

Webhook URL for placing Option Orders (ITM/OTM/ATM)

Broker - AliceBlue
https://abapi.algomojo.com/1.0/PlaceFOOptionsOrder 

Broker - Tradejini
https://tjapi.algomojo.com/1.0/PlaceFOOptionsOrder 

Broker - Zebu
https://zbapi.algomojo.com/1.0/PlaceFOOptionsOrder

Webhook Message FormatSample Option Order Example (4 strike wide OTM call option from the At the money strike price)

{
  "api_key":"c1997d92a3bb556a67dca7d1446b7087",
  "api_secret":"5306433329e81ba41203653417063c71",
  "data":
    {
      "strg_name":"Options",
      "spot_sym":"NIFTY",
      "expiry_dt":"20OCT20",
      "opt_type":"CE",
      "Ttranstype":"B",
      "prctyp":"MKT",
      "qty":"75",
      "Price":"0",
      "TrigPrice":"0",
      "Pcode":"NRML",
      "strike_int":"50",
      "offset":"4"
    }
}

Where to Check the Order in Realtime in Algomojo

You can use order logs to check for any incoming automated orders generating from Tradingview Webhooks in Realtime and can also download the logs for later use.

Let me know in comments if you find this tutorial useful or incase if you need more details about algomojo integration with tradingview you can comment your inputs below.

Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

Dive Into the TradingView Paper Trading Competition: A Chance…

Welcome to an exhilarating opportunity presented by TradingView – a paper trading competition that not only tests your trading acumen but also offers a...
Rajandran R
1 min read

Introducing PineGPT – To Build Better Tradingview Pinescript Codes

PineGPT is a customGPT for ChatGPT4 users designed to provide expert guidance on creating and understanding TradingView Pine Script indicators and trading strategies. PineGPT...
Rajandran R
1 min read

5Paisa – Tradingview Webhook Automation Module

In this tutorial, we will be learning how to use the 5Paisa – Tradingview Webhook feature for automating your Tradingview pinescript strategy. This Module...
Rajandran R
10 min read

One Reply to “How to Send Automated Orders from Tradingview to Algomojo…”

  1. Hi Rajendra R,

    how to place limit order using below JSON. like “prctyp”:”MKT”, it is using market price which take 1 to 5 seconds, instead of i want to use LMT so when indicator return BUY it will send to broker for same as a limit order. please resolve the issue.

    {
    “api_key”:””,
    “api_secret”:””,
    “data”:
    {
    “strg_name”:”UPLBS”,
    “s_prdt_ali”:”BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML”,
    “Tsym”:”UPL-EQ”,
    “exch”:”NSE”,
    “Ttranstype”:”{{strategy.order.comment}}”,
    “Ret”:”DAY”,
    “prctyp”:”MKT”,
    “qty”:”120″,
    “discqty”:”0″,
    “MktPro”:”NA”,
    “Price”:”0″,
    “TrigPrice”:”0″,
    “Pcode”:”MIS”,
    “AMO”:”NO”
    }
    }

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More