Skip to main content

Strategies

Short Straddle

The Short Straddle 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 should be same 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/shortStraddle

Request details

API Parameters
Parameter Description Example
symbol
String
Trading Symbol e.g.,
"NIFTY", "BANKNIFTY"
NIFTY
strikePrice
String
Strike Price of the symbol
e.g., "17500", "16130"
17500
expiry
String
Expiry Date month year
e.g., "03NOV22"
16JAN23
product
String
Product type: 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
ShortStraddle
WithoutHedge
hedge
Bool
This parameter enables the hedge to
be used or not
true
hedgeValue
Integer
ATM value for the hedge
to be placed
300
jKey
String
Key Obtained on login
success
28fa3983bd7a6334848
userId
String
User Id of the login
user
AA1999

Libraries and SDKs

Tabbed Interface
from thefirstock import thefirstock

SS = thefirstock.firstock_ShortStraddle(
    symbol="NIFTY",
    strikePrice="18000",
    expiry="23FEB23",
    product="C",
    quantity="10",
    remarks="Hello",
    hedgeValue=300,
    hedge=False,
    priceType="MKT",
    retention="DAY",
    jKey="{{jKey}}",
    userId="{{userId}}"
)
curl --location --request POST 'https://connect.thefirstock.com/api/V4/strategies/shortStraddle' \
--header 'Content-Type: application/json' \
--data-raw '{
  "jKey": "{{jKey}}",
  "userId": "{{userID}}",
  "symbol": "",
  "strikePrice": "",
  "expiry": "",
  "product": "",
  "quantity": "",
  "exchange": "",
  "priceType": "",
  "retention": "",
  "hedge": false,
  "hedgeValue": "",
  "remarks": ""
}'
const Firstock = require("thefirstock");

const firstock = new Firstock();
firstock.shortStraddle(
  {
    userId: {{userId}},
    symbol: "NIFTY",
    strikePrice: "17000",
    expiry: "10NOV22",
    product: "I",
    quantity: "1",
    remarks: "ShortStraddleWithoutHedge",
    hedge: "false",
    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.shortStraddle(userId: {{userId}},
                                            symbol: "NIFTY",
                                            strikePrice: "17000",
                                            expiry: "02MAR23",
                                            product: "I",
                                            quantity: "1",
                                            remarks: "ShortStraddleWithoutHedge",
                                            hedge: "false",
                                            hedgeValue: "300"
                                            );
    }
}

Success response details

API Parameters
Parameter Description Example
status
String
Indicates the result status success
data.requestTime
String
Response received time 17:42:39 16-02-2023
data.orderNumber
String
Present only on successful
order placement to OMS
1234567890111
[
  {
    status: "success",
    data: {
      requestTime: "17:42:39 16-02-2023",
      orderNumber: "1234567890111",
    },
  },
  {
    status: "success",
    data: {
      requestTime: "17:42:39 16-02-2023",
      orderNumber: "1234567890111",
    },
  },
];

Failure response details

API Parameters
Parameter Description Example
status
String
Indicates the result status
of the API operation
failed
code
String
HTTP status code associated
with the error
400
name
String
Specifies the type or category
of the error encountered
BAD_REQUEST
error.field
String
Field in the request that
triggered the error
Count
error.message
String
Detailed message describing
the error
product cannot be undefined
or NULL
{
    "status": "failed",
    "code": "400",
    "name": "BAD_REQUEST",
    "error": {
        "field": "product",
        "message": "product cannot be undefined or NULL"
    }
}