It looks like you're new here. If you want to get involved, click one of these buttons!
def get_basket_margin(call_buy_strike,call_strike_sell,put_buy_strike,put_strike_sell,qty):
global initial_margin
global final_margin
basket_order_margin=kite.basket_order_margins([{
"exchange": "NFO",
"tradingsymbol": call_buy_strike['tradingsymbol'],
"transaction_type": "BUY",
"variety": "regular",
"product": "MIS",
"order_type": "MARKET",
"quantity": qty,
"price": 0,
"trigger_price": 0,
},{
"exchange": "NFO",
"tradingsymbol": call_strike_sell['tradingsymbol'],
"transaction_type": "SELL",
"variety": "regular",
"product": "MIS",
"order_type": "MARKET",
"quantity": qty,
"price": 0,
"trigger_price": 0
},{"exchange": "NFO",
"tradingsymbol": put_buy_strike['tradingsymbol'],
"transaction_type": "BUY",
"variety": "regular",
"product": "MIS",
"order_type": "MARKET",
"quantity": qty,
"price": 0,
"trigger_price": 0},{"exchange": "NFO",
"tradingsymbol": put_strike_sell['tradingsymbol'],
"transaction_type": "BUY",
"variety": "regular",
"product": "MIS",
"order_type": "MARKET",
"quantity": qty,
"price": 0,
"trigger_price": 0}])
initial_margin=basket_order_margin['initial']['total']
final_margin=basket_order_margin['final']['total']
Please find the screenshot for reference
Can you paste here the debug log of the request?
I