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 Option Orders from Nifty Charts using Tradingview Platform?

1 min read

Algomojo provides functionality to send option orders using PlaceFOOptionsOrder function. which can be used to send automated orders from Tradingview/Amibroker application to trigger ITM/ATM/OTM option orders.

Algomojo offers free API + Free Platform with No upfront fees,  no minimum turnover, no special terms and conditions, no clauses, no strings attached for the algomojo clients.

PlaceFOOptionsOrder API information

Here is the sample request and response example from the algomojo documentation.

# Here is a curl example
curl \
-X POST https://abapi.algomojo.com/1.0/PlaceFOOptionsOrder
-X POST https://tjapi.algomojo.com/1.0/PlaceFOOptionsOrder
-X POST https://zbapi.algomojo.com/1.0/PlaceFOOptionsOrder

                
To get characters you need to make a POST call to the following url :
https://abapi.algomojo.com/1.0/PlaceFOOptionsOrder https://tjapi.algomojo.com/1.0/PlaceFOOptionsOrder https://zbapi.algomojo.com/1.0/PlaceFOOptionsOrder



Request example :

{
  "api_key":"c1997d92a3bb556a67dca7d1446b7087",
  "api_secret":"5306433329e81ba41203653417063c71",
  "data":
    {
      "strg_name":"Options",
      "spot_sym":"NIFTY",
      "expiry_dt":"05NOV20",
      "opt_type":"PE",
      "Ttranstype":"B",
      "prctyp":"MKT",
      "qty":"75",
      "Price":"0",
      "TrigPrice":"0",
      "Pcode":"NRML",
      "strike_int":"50",
      "offset":"10"
    }
}

Response example :
{
    "NOrdNo": "200810000017432",
    "stat": "Ok"
}

In the previous tutorial, we learn how to send automated orders from tradingview platform. The same way one can send automated option orders from Tradingview Charts/Strategies.

Understanding the ATM/ITM/OTM options selection process

One can select the ATM/ITM/OTM strike price automatically by selecting the offset value as shown from the above API request information. For placing orders in ATM strikes one have to send the offset value to zero and if one needs to select lower strike price then negative offset needs to be used and positive offset for selecting higher strike price than the last traded price.

Below example explains the various offset values and how to ATM/ITM/OTM values are decided based on the offset parameter selection.

Tradingview Webhook

Tradingview supports webhook alerts from Tradingview Pro plan onwards. 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.

Tradingview Webhook 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 Option orders (ATM/ITM/OTM orders)

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 Format – Sample PlaceFOOrder Example

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

Note : One can send orders from Nifty Spot/Nifty Futures and also the ATM/ITM/OTM calculations will be done at the Algomojo end and not at the Tradingview side.

Here order is send for ATM PE for 05th Nov 2020 contract and the execution happened immediately at 12100PE when the Nifty spot price is around 12085 levels.

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.

AllinOneAlerts – Amibroker Alerts Module for Amibroker Users

AllinOneAlerts is one of the most important and most requested modules to bring all sorts of alerts with no extra coding efforts. Now even...
Rajandran R
5 min read

Intraday Straddle Execution Module – Amibroker for AngelOne Users

This tutorial focus on how to automate your time-based index straddle/strangle management with intraday stop-loss levels with time-based entry and exits using Algomojo Platform...
Rajandran R
11 min read

Intraday Straddle Execution Module – Amibroker for Upstox Users

This tutorial focus on how to automate your time-based index straddle/strangle management with intraday stop-loss levels with time-based entry and exits using Algomojo Platform...
Rajandran R
11 min read

4 Replies to “How to Send Option Orders from Nifty Charts using…”

Leave a Reply

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