Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

How to Send Automated Orders from Tradingview to Algomojo Platform

2 min read

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

Webhook is a unique way of communicating in realtime from one application to another application. Webhooks are automatic. You don’t have to manually utilize them in order to make them work — once they’re set up, they run on their own.

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 allow 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 Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

VB Script for Placing Orders From Excelsheet to Algomojo…

This tutorial provides a sample VB Script code to place orders from the Algomojo Platform. Algomojo offers Free API + Free Trading Platform to...
Rajandran R
2 min read

How to use Postman to Send Orders to Your…

Postman is an API testing tool that started in 2012 as a side project by Abhinav Asthana to simplify API workflow in testing and...
Rajandran R
1 min read

What is Algomojo API?

Algomojo offers Free API + Free Trading Platform to algomojo users to Place, Modify, Cancel Orders. Currently, Algomojo API is free for the users...
Rajandran R
2 min read

Leave a Reply

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