Short Strangle
The Short Strangle places two orders which one leg will be call and another will be put, the strike price can be defined by the users and both the strike prices could be different, over here the user is able to define hedge value which will then place two buy and two sell orders.
Method: POST
https://connect.thefirstock.com/api/V4/strategies/shortStrangle
Request details
Parameter | Description | Example |
---|---|---|
symbol String |
Trading Symbol e.g. "NIFTY", "BANKNIFTY" |
NIFTY |
callStrikePrice String |
Strike Price of the symbol e.g. "17500", "16130" |
17500 |
putStrikePrice String |
Strike Price of the symbol e.g. "17500", "16130" |
17500 |
expiry String |
Date month year e.g. "03NOV22" |
16JAN23 |
product String |
C / M / I C -> Cash and Carry, M -> F&O Normal, I -> Intraday |
C |
quantity String |
Order Quantity | 1 |
remarks String |
User can send remarks for the order |
shortStrangle |
hedge bool |
This parameter enables the hedge to be used or not |
false |
hedgeValue Integer |
ATM value for the hedge to be placed |
300 |
jKey String |
Key Obtained on login success. |
d4180daa72e |
userId String |
User Id of the login user |
AA1999 |
Libraries and SDKs
from thefirstock import thefirstock
SS = thefirstock.firstock_ShortStrangle(
symbol="NIFTY",
callStrikePrice="18000",
putStrikePrice="17800",
expiry="23FEB23",
product="C",
quantity="10",
remarks="Hello",
hedgeValue=300,
hedge=True,
priceType="MKT",
retention="DAY",
jKey="{{jKey}}",
userId="{{userId}}"
)
curl --location --request POST 'https://connect.thefirstock.com/api/V4/strategies/shortStrangle' \
--header 'Content-Type: application/json' \
--data-raw '{
"jKey": "{{jKey}}",
"userId": "{{userID}}",
"callStrikePrice": "",
"putStrikePrice": "",
"symbol": "",
"expiry": "",
"product": "",
"quantity": "",
"exchange": "",
"priceType": "",
"retention": "",
"hedge": false,
"hedgeValue": "",
"remarks": ""
}'
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.shortStrangle(
{
userId: {{userId}},
symbol: "NIFTY",
callStrikePrice: "17500",
putStrikePrice: "17000",
expiry: "10NOV22",
product: "I",
quantity: "1",
remarks: "ShortStrangleWithOutHedge",
hedge: "True",
hedgeValue: "300",
},
(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.shortStrangle(userId: {{userId}},
symbol: "NIFTY",
callStrikePrice: "17500",
putStrikePrice: "17000",
expiry: "02MAR23",
product: "I",
quantity: "1",
remarks: "ShortStrangleWithOutHedge",
hedge: "True",
hedgeValue: "300"
);
}
}
Success response details
Parameter | Description | Example |
---|---|---|
status String |
Indicates the success status of the API operation |
success |
data.requestTime String |
Timestamp marking when the response was received |
17:46:08 16-02-2023 |
data.orderNumber String |
Unique identifier of the order, present only on successful placement to OMS |
12345678 |
[
{
status: "success",
data: {
requestTime: "17:46:08 16-02-2023",
orderNumber: "1234567890111",
},
},
{
status: "success",
data: {
requestTime: "17:46:08 16-02-2023",
orderNumber: "1234567890111",
},
},
];
Failure response details
Parameter | Description | Example |
---|---|---|
status String |
Indicates the result status of the API operation |
failed |
code String |
HTTP status code associated with the error |
401 |
name String |
Type of error | BAD_REQUEST |
error.field String |
Error field | quantity |
error.message String |
Error message | quantity cannot be undefined or NULL |
{
"status": "failed",
"code": "400",
"name": "BAD_REQUEST",
"error": {
"field": "quantity",
"message": "quantity cannot be undefined or NULL"
}
}