Option greek
Refer to a set of calculations you can use to measure different factors that might affect the price of an options contract.
Method: POST
https://connect.thefirstock.com/api/V3/optionGreek
Request details
Parameter | Description | Data types | Example |
---|---|---|---|
expiryDate | Expiry Date | String | "01-DEC-2022" |
strikePrice | Strike Price | String | "42000" |
spotPrice | Spot Price | String | "39546" |
initRate | Init Rate | String | "10" |
volatility | Volatility | String | "10" |
optionType | Option Type | String | "PE" |
- cURL
curl -X POST 'https://connect.thefirstock.com/api/V3/optionGreek'
-H 'Content-Type: application/json'
-d '{
"expiryDate": "23-FEB-2023",
"strikePrice": "17000",
"spotPrice": "38850",
"initRate": "10",
"volatility": "20",
"optionType": "PE"
}'
from thefirstock import thefirstock
optionGreek = thefirstock.firstock_OptionGreek(
expiryDate='23-FEB-2023',
strikePrice="17000",
spotPrice="38850",
initRate="10",
volatility="20",
optionType="PE",
)
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.optionGreek(
{
expiryDate: "23-FEB-2023",
strikePrice: "17000",
spotPrice: "38850",
initRate: "10",
volatility: "20",
optionType: "PE",
},
(err, result) => {
console.log("Error, ", err);
console.log("Result: ", result);
}
);
using thefirstock;
class Program
{
public static void Main()
{
Firstock firstock = new Firstock();
var result = firstock.optionGreek( expiryDate: "02-MAR-2023",
strikePrice: "17000",
spotPrice: "38850",
initRate: "10",
volatility: "20",
optionType: "PE"
);
}
}
Success response details
Parameter | Description | Data types | Examples |
---|---|---|---|
status | Success | String | "Success" |
data.stat | success or failure indication. | String | "ok" |
data.request_time | This will be present only in a successful response | String | "14:00:49 20-02-2023" |
data.cal_price | Cal Price | String | "11795.41" |
data.put_price | Put Price | String | "9564.03" |
data.cal_delta | Cal Delta | String | "0.836474" |
data.put_delta | Put Delta | String | "-0.163526" |
data.cal_gamma | Cal Gamma | String | "0.000008" |
data.put_gamma | Put Gamma | String | "0.000008" |
data.cal_theta | Cal Theta | String | "-1421.069777" |
data.put_theta | Put Theta | String | "-992.066490" |
data.cal_rho | Cal Rho | String | "0.260474" |
data.put_rho | Put Rho | String | "-1.026535" |
data.cal_vego | Cal Vego | String | "4.002735" |
data.put_vego | Put Vego | String | "4.002735" |
Failure response details
Parameter | Description | Data Type | Example |
---|---|---|---|
status | Failed | String | "Failed" |
code | HTTP Code | String | "404" |
name | Type of error | String | "ORDERS_NOT_FOUND" |
error.field | Error field | String | "orderDetails" |
error.message | Error message | String | "No data on the orders was found" |
Sample response
- Success response
- Failure response
{
"status": "Success",
"data": {
"request_time": "14:00:49 20-02-2023",
"stat": "OK",
"cal_price": "11795.41",
"put_price": "9564.03",
"cal_delta": "0.836474",
"put_delta": "-0.163526",
"cal_gamma": "0.000008",
"put_gamma": "0.000008",
"cal_theta": "-1421.069777",
"put_theta": "-992.066490",
"cal_rho": "0.260474",
"put_rho": "-1.026535",
"cal_vega": "4.002735",
"put_vega": "4.002735"
}
}
{
"status": "Failed",
"code": "404",
"name": "ORDERS_NOT_FOUND",
"error": {
"field": "orderDetails",
"message": "No data on the orders was found"
}
}