Bull call spread
The Bull Call Spread places two orders which both the legs will be call and in which the first one is bought and second one is sold, the strike price can be defined by the users.
Method : POST
https://connect.thefirstock.com/api/V3/strategies/bullCallSpread
Request details
Parameter | Description | Data types | Example |
---|---|---|---|
symbol | Trading Symbol e.g.("NIFTY", "BANKNIFTY") | String | "NIFTY" |
callBuyStrikePrice | Strike Price of the symbol e.g.("17500", "16130") | String | "17500" |
callSellStrikePrice | Strike Price of the symbol e.g.("17500", "16130") | String | "18000" |
expiry | Date month year e.g.("03NOV22") | String | "16JAN23" |
product | C / M / I C -> Cash and Carry, M -> F&O Normal, I -> Intraday | String | "I" |
quantity | Order Quantity | String | "1" |
remarks | User can send remarks for the order | String | "BullCallSpread" |
jKey | Key Obtained on login success. | String | "28fa3983bd7a6334848b eeb7358ab57fccf19d46a b16c7dac81bf154e65061ce" |
userId | User Id of the login user | String | "AA1999" |
- cURL
curl --location 'https://connect.thefirstock.com/api/V3/strategies/bullCallSpread' \
--header 'Content-Type: application/json' \
--data '{
"symbol": "NIFTY",
"callBuyStrikePrice": "18000",
"callSellStrikePrice": "17800",
"expiry": "23FEB23",
"product": "C",
"quantity": "20",
"remarks": "Test1",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38",
"userId": "AA123"
}'
from thefirstock import thefirstock
BCS = thefirstock.firstock_BullCallSpread(
symbol="NIFTY",
callBuyStrikePrice="18000",
callSellStrikePrice="17800",
expiry="23FEB23",
product="C",
quantity="15",
remarks="Hello"
)
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.bullCallSpread(
{
symbol: "NIFTY",
callBuyStrikePrice: "18000",
callSellStrikePrice: "17000",
expiry: "10NOV22",
product: "I",
quantity: "1",
remarks: "BullCallSpread",
},
(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.bullCallSpread(symbol: "NIFTY",
callBuyStrikePrice: "18000",
callSellStrikePrice: "17000",
expiry: "02MAR23",
product: "I",
quantity: "1",
remarks: "BullCallSpread"
);
}
}
Success response details
Parameter | Description | Data types | Example |
---|---|---|---|
status | Success | String | "Success" |
data.requestTime | Response received time. | String | "17:49:14 16-02-2023" |
data.orderNumber | It will be present only on successful Order placement to OMS. | String | "1234567890111" |
Failure response details
Parameter | Description | Data Type | Example |
---|---|---|---|
status | Failed | String | "Failed" |
code | HTTP Code | String | "401" |
name | Type of error | String | "INVALID_JKEY" |
error.field | Error field | String | "jkey" |
error.message | Error message | String | "jKey parameter is invalid" |
Sample response
- Success response
- Failure response
[
{
status: "Success",
data: {
requestTime: "17:49:14 16-02-2023",
orderNumber: "1234567890111",
},
},
{
status: "Success",
data: {
requestTime: "17:49:14 16-02-2023",
orderNumber: "1234567890111",
},
},
];
[
{
status: "Failed",
code: "401",
name: "INVALID_JKEY",
error: {
field: "jKey",
message: "jKey parameter is invalid",
},
},
{
status: "Failed",
code: "401",
name: "INVALID_JKEY",
error: {
field: "jKey",
message: "jKey parameter is invalid",
},
},
];