Option Greeks: The strikePrice must be integer, but returned as float (string).
-
Namaskara,
The response value of Option Greeks, is listed as follows in the documentation:
Sample Response:
{
"status": true,
"message": "SUCCESS",
"errorcode": "",
"data": [
{
"name": "TCS",
"expiry": "25JAN2024",
"strikePrice": "3900.000000",
"optionType": "CE",
"delta": "0.492400",
"gamma": "0.002800",
"theta": "-4.091800",
"vega": "2.296700",
"impliedVolatility": "16.330000",
"tradeVolume": "24048.00"
},
{
"name": "TCS",
"expiry": "25JAN2024",
"strikePrice": "4000.000000",
"optionType": "CE",
"delta": "0.239000",
"gamma": "0.002200",
"theta": "-3.033500",
"vega": "1.785400",
"impliedVolatility": "22.190000",
"tradeVolume": "12976.00"
}Here the option strikePrice is returned as 3900.000000
this is wrong.
The above is string representation of a float value.
Option Strike price is never float. It must a integer ... say as 3900 (no decimal point and digits after that).
If the conversion from the float string representation to integer is executed, then it results in rounding errors (the value will be nearest approximation) which cannot be equated with Integer (non decimal number).
In this case to convert the string to integer, we must first strip all digits after decimal (including the decimal point) and then convert to integer.
It is ideal and highly recommended that this value is returned as 3900 (with no decimal point) rather than 3900.000000.
Regards
Rathnadhar K V
(Writing the C++ api for Angel One connector)... -
Hello, we do acknowledge your feedback, but as of now, please consider it as a float.