I am trying to create a basket order programatically to check the margin requirements. But it is always giving zero values though the parameters are correct
Thanks Salim. Code executed with NFO setting. However, the basket order is not listed on the page. Any basket order created should be visible on the Zerodha page right?
basket = [ { "exchange": "NFO", "tradingsymbol": "NIFTY2611325000PE", "transaction_type": "BUY", "quantity": 65, "product": "NRML", "order_type": "MARKET", } ] margin_data = kite.basket_order_margins(basket, consider_positions=False) data = margin_data.get("data", {}) Returns empty data. Can someone let me know what I am missing? Goal is to check the margin requirements programatically
@subha There is currently no direct API available for placing basket orders. We also do not observe any issues with basket order margins; please refer to the Basket Margin API documentation for detailed information on margin calculations.
I don't need to place any basket order. I just want to check the margins.
basket = [ { "exchange": "NFO", "tradingsymbol": "NIFTY2611325000PE", "transaction_type": "BUY", "variety": "regular", "quantity": 65, "product": "NRML", "order_type": "MARKET", "price":0, "trigger_price": 0 } ] margin_data = kite.basket_order_margins(basket, consider_positions=False) data = margin_data.get("data", {}) I am using the above code. But it returns all zeros. Span and exposure is zero.
NFOand check.Any basket order created should be visible on the Zerodha page right?
{
"exchange": "NFO",
"tradingsymbol": "NIFTY2611325000PE",
"transaction_type": "BUY",
"quantity": 65,
"product": "NRML",
"order_type": "MARKET",
}
]
margin_data = kite.basket_order_margins(basket, consider_positions=False)
data = margin_data.get("data", {})
Returns empty data. Can someone let me know what I am missing?
Goal is to check the margin requirements programatically
basket = [
{ "exchange": "NFO",
"tradingsymbol": "NIFTY2611325000PE",
"transaction_type": "BUY",
"variety": "regular",
"quantity": 65,
"product": "NRML",
"order_type": "MARKET",
"price":0,
"trigger_price": 0 }
]
margin_data = kite.basket_order_margins(basket, consider_positions=False)
data = margin_data.get("data", {})
I am using the above code. But it returns all zeros. Span and exposure is zero.
Initial Margin : {'type': '', 'tradingsymbol': '', 'exchange': '', 'span': 0, 'exposure': 0, 'option_premium': 321.75, 'additional': 0, 'bo': 0, 'cash': 0, 'var': 0, 'pnl': {'realised': 0, 'unrealised': 0}, 'leverage': 0, 'charges': {'transaction_tax': 0, 'transaction_tax_type': '', 'exchange_turnover_charge': 0, 'sebi_turnover_charge': 0, 'brokerage': 0, 'stamp_duty': 0, 'gst': {'igst': 0, 'cgst': 0, 'sgst': 0, 'total': 0}, 'total': 0}, 'total': 321.75}
*******************************************************************
Final Margin : {'type': '', 'tradingsymbol': '', 'exchange': '', 'span': 0, 'exposure': 0, 'option_premium': 321.75, 'additional': 0, 'bo': 0, 'cash': 0, 'var': 0, 'pnl': {'realised': 0, 'unrealised': 0}, 'leverage': 0, 'charges': {'transaction_tax': 0, 'transaction_tax_type': '', 'exchange_turnover_charge': 0, 'sebi_turnover_charge': 0, 'brokerage': 0, 'stamp_duty': 0, 'gst': {'igst': 0, 'cgst': 0, 'sgst': 0, 'total': 0}, 'total': 0}, 'total': 321.75}
*******************************************************************
Margin Type : None
'tradingsymbol': '',
'exchange': '',
'span': 0,
'exposure': 0,
'option_premium': 321.75,
'additional': 0,
'bo': 0,
'cash': 0,
'var': 0,
'pnl': {'realised': 0, 'unrealised': 0},
'leverage': 0,
'charges': {'transaction_tax': 0,
'transaction_tax_type': '',
'exchange_turnover_charge': 0,
'sebi_turnover_charge': 0,
'brokerage': 0,
'stamp_duty': 0,
'gst': {'igst': 0, 'cgst': 0, 'sgst': 0, 'total': 0},
'total': 0},
'total': 321.75},
'final': {'type': '',
'tradingsymbol': '',
'exchange': '',
'span': 0,
'exposure': 0,
'option_premium': 321.75,
'additional': 0,
'bo': 0,
'cash': 0,
'var': 0,
'pnl': {'realised': 0, 'unrealised': 0},
'leverage': 0,
'charges': {'transaction_tax': 0,
'transaction_tax_type': '',
'exchange_turnover_charge': 0,
'sebi_turnover_charge': 0,
'brokerage': 0,
'stamp_duty': 0,
'gst': {'igst': 0, 'cgst': 0, 'sgst': 0, 'total': 0},
'total': 0},
'total': 321.75},
'orders': [{'type': 'equity',
'tradingsymbol': 'NIFTY2611325000PE',
'exchange': 'NFO',
'span': 0,
'exposure': 0,
'option_premium': 321.75,
'additional': 0,
'bo': 0,
'cash': 0,
'var': 0,
'pnl': {'realised': 0, 'unrealised': 0},
'leverage': 1,
'charges': {'transaction_tax': 0,
'transaction_tax_type': 'stt',
'exchange_turnover_charge': 0.11431777500000001,
'sebi_turnover_charge': 0.00032175,
'brokerage': 20,
'stamp_duty': 0,
'gst': {'igst': 3.6206351145, 'cgst': 0, 'sgst': 0, 'total': 3.6206351145},
'total': 23.735274639500002},
'total': 321.75}],
'charges': {'transaction_tax': 0,
'transaction_tax_type': '',
'exchange_turnover_charge': 0,
'sebi_turnover_charge': 0.00032175,
'brokerage': 20,
'stamp_duty': 0,
'gst': {'igst': 0, 'cgst': 0, 'sgst': 0, 'total': 0},
'total': 0}}
This is the output I get. The margin api documentation and code is what I have referred to .
Can you please let me know where the issue could be.