To get the option greek for a strike price, the request has few parameters:
curl -X POST ‘https://connect.thefirstock.com/api/V3/optionGreek’
-H ‘Content-Type: application/json’
-d ‘{
“expiryDate”: “”,
“strikePrice”: “”,
“spotPrice”: “”,
“initRate”: “”,
“volatility”: “”,
“optionType”: “”,
}’
What to give for initRate and volatility values?
Hi Venkat,
For the initRate you can use the value 10 which is mentioned in the nse website
- 10% interest rate is applied while computing implied volatility.
And for the volatility you need to calculate the value, if you are using python then there is a library available for calculating the implied volatility, please find the reference over here on this site for calculating IV
http://vollib.org/documentation/python/1.0.2/apidoc/py_vollib.black_scholes.html
We shall be shortly coming up with short videos regarding the API usage and also with strategy builder using the packages and API, please feel free to request if you have any content that has to be made.
Can you please provide the Delta of CE and PE along with option chain API ? This way there is no need for the user to use another API
For the value I passed I am getting invalid results . May be my IV is wrong, but I passed it from Opstra option chain.
curl --location ‘https://connect.thefirstock.com/api/V3/optionGreek’
–header ‘Content-Type: application/json’
–data '{
"expiryDate": "29-MAR-2023",
"strikePrice": "39400",
"spotPrice": "39395",
"initRate": "7.318",
"volatility": "19.81",
"optionType": "PE",
}'
7.318 is the risk free interest rate
IV 19.81 is taken from NSE option chain for SP 39400
Response
{
“status”: “Success”,
“data”: {
“request_time”: “19:32:05 25-03-2023”,
“stat”: “OK”,
“cal_price”: “28053.13”,
“put_price”: "25021.74",
“cal_delta”: “0.858927”,
“put_delta”: “-0.141073”,
“cal_gamma”: “0.000003”,
“put_gamma”: “0.000003”,
“cal_theta”: “-2400.775124”,
“put_theta”: “-1671.709645”,
“cal_rho”: “0.633898”,
“put_rho”: “-3.351156”,
“cal_vega”: “9.226870”,
“put_vega”: “9.226870”
}
}
I put the same value in Option Price Calculator . Only difference is instead of date, given 5 days to expiry. THe result is close to NSE option price. Refer screen shot : option.PNG - Google Drive.
Hello Suresh,
We are currently working on the API and will be available by the next release.