Rajandran R Creator of OpenAlgo - OpenSource Algo Trading framework for Indian Traders. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, 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. Building Algo Platforms, Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in

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 Creator of OpenAlgo - OpenSource Algo Trading framework for Indian Traders. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, 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. Building Algo Platforms, Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in

Introducing OpenAlgo V1.0: The Ultimate Open-Source Algorithmic Trading Framework…

OpenAlgo V1.0 is an open-source algorithmic trading platform to automate your trading strategies using Amibroker, Tradingview, Metatrader, Python etc. Designed with the modern trader...
Rajandran R
2 min read

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

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