Quantcast
Viewing all articles
Browse latest Browse all 2070

How to Send Automated Orders from Tradingview to Algomojo Platform

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

Image may be NSFW.
Clik here to view.

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

Image may be NSFW.
Clik here to view.

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.

Image may be NSFW.
Clik here to view.

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.

Related Readings and Observations

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 2070

Trending Articles