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 and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

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 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 and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

Line Trading – Algomojo Automation Module for Amibroker Users

The line Trading Automation tool is designed for Manual traders who want to perform level-based trade execution faster and also bring some advanced trade...
Rajandran R
58 sec read

Tradingview Pinescript v5 – Masterclass

This Pinescript Masterclass course covers trading system development and automation using Tradingview Pinescript v5. The course is designed for traders who want to learn...
Rajandran R
2 min read

Mini Certification Course on Algorithmic Trading Strategies

If you are new to Automated trading? This certification course will help you to kickstart your automated trading with your broker and get to...
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