☰
Login
Signup
Home
›
.Net / VBA / Excel (3rd party)
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.9K
All Categories
0
Incidents
156
Node JS client
40
Go client
793
.Net API client
380
Kite Publisher
537
.Net / VBA / Excel (3rd party)
458
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
348
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
July 2023
tradermangesh
July 2023
sujith
How to find basket margin (say for Iron Condor) using c# ?
tradermangesh
July 2023
in
.Net / VBA / Excel (3rd party)
How to find basket margin (say for Iron Condor) using c# ?
I am using MarginList = kite.GetOrderMargins(ordersList); in c# but its not giving basket margin
I am finding only following for margin related functions
kite.GetOrderMargins
and
kite.GetMargins
There is no function for getting Basket Margin
sujith
July 2023
You are referring to
official .NET library
or
@HowUTrade
library?
tradermangesh
July 2023
I have downloaded official .net library... it has only 2 choices
kite.GetOrderMargins and
kite.GetMargins
I want to get basket margin for 4 trades together
tradermangesh
July 2023
My code is as follows
CE_Sell_Strike = "46500";
PE_Sell_Strike = "45500";
CE_Buy_Strike = 46800;
PE_Buy_Strike = 45200;
string ScriptName = "BANKNIFTY";
int ScriptLotSize = 15;
string CE_SELL_Symbol = ScriptName + Kite_BNF_Exp_O + CE_Sell_Strike + "CE";
string PE_SELL_Symbol = ScriptName + Kite_BNF_Exp_O + PE_Sell_Strike + "PE";
string CE_Buy_Symbol = ScriptName + Kite_BNF_Exp_O + Convert.ToString(CE_Buy_Strike) + "CE";
string PE_Buy_Symbol = ScriptName + Kite_BNF_Exp_O + Convert.ToString(PE_Buy_Strike) + "PE";
OrderMarginParams order1Params = new OrderMarginParams();
order1Params.Exchange = "NFO";
order1Params.TradingSymbol = CE_SELL_Symbol;
order1Params.TransactionType = Constants.TRANSACTION_TYPE_SELL;
order1Params.Variety = "regular";
order1Params.Product = Constants.PRODUCT_NRML;
order1Params.OrderType = Constants.ORDER_TYPE_MARKET;
order1Params.Quantity = ScriptLotSize;
OrderMarginParams order2Params = new OrderMarginParams();
order2Params.Exchange = "NFO";
order2Params.TradingSymbol = PE_SELL_Symbol;
order2Params.TransactionType = Constants.TRANSACTION_TYPE_SELL;
order2Params.Variety = "regular";
order2Params.Product = Constants.PRODUCT_NRML;
order2Params.OrderType = Constants.ORDER_TYPE_MARKET;
order2Params.Quantity = ScriptLotSize;
OrderMarginParams order3Params = new OrderMarginParams();
order3Params.Exchange = "NFO";
order3Params.TradingSymbol = CE_Buy_Symbol;
order3Params.TransactionType = Constants.TRANSACTION_TYPE_BUY;
order3Params.Variety = "regular";
order3Params.Product = Constants.PRODUCT_NRML;
order3Params.OrderType = Constants.ORDER_TYPE_MARKET;
order3Params.Quantity = ScriptLotSize;
OrderMarginParams order4Params = new OrderMarginParams();
order4Params.Exchange = "NFO";
order4Params.TradingSymbol = PE_Buy_Symbol;
order4Params.TransactionType = Constants.TRANSACTION_TYPE_BUY;
order4Params.Variety = "regular";
order4Params.Product = Constants.PRODUCT_NRML;
order4Params.OrderType = Constants.ORDER_TYPE_MARKET;
order4Params.Quantity = ScriptLotSize;
List ordersList = new List();
ordersList.Add(order3Params);
ordersList.Add(order4Params);
ordersList.Add(order1Params);
ordersList.Add(order2Params);
List MarginList = new List();
MarginList = kite.GetOrderMargins(ordersList);
sujith
July 2023
Can you try using the latest version of the library? It is there in the
source code
.
Sign In
or
Register
to comment.
kite.GetOrderMargins and
kite.GetMargins
I want to get basket margin for 4 trades together
CE_Sell_Strike = "46500";
PE_Sell_Strike = "45500";
CE_Buy_Strike = 46800;
PE_Buy_Strike = 45200;
string ScriptName = "BANKNIFTY";
int ScriptLotSize = 15;
string CE_SELL_Symbol = ScriptName + Kite_BNF_Exp_O + CE_Sell_Strike + "CE";
string PE_SELL_Symbol = ScriptName + Kite_BNF_Exp_O + PE_Sell_Strike + "PE";
string CE_Buy_Symbol = ScriptName + Kite_BNF_Exp_O + Convert.ToString(CE_Buy_Strike) + "CE";
string PE_Buy_Symbol = ScriptName + Kite_BNF_Exp_O + Convert.ToString(PE_Buy_Strike) + "PE";
OrderMarginParams order1Params = new OrderMarginParams();
order1Params.Exchange = "NFO";
order1Params.TradingSymbol = CE_SELL_Symbol;
order1Params.TransactionType = Constants.TRANSACTION_TYPE_SELL;
order1Params.Variety = "regular";
order1Params.Product = Constants.PRODUCT_NRML;
order1Params.OrderType = Constants.ORDER_TYPE_MARKET;
order1Params.Quantity = ScriptLotSize;
OrderMarginParams order2Params = new OrderMarginParams();
order2Params.Exchange = "NFO";
order2Params.TradingSymbol = PE_SELL_Symbol;
order2Params.TransactionType = Constants.TRANSACTION_TYPE_SELL;
order2Params.Variety = "regular";
order2Params.Product = Constants.PRODUCT_NRML;
order2Params.OrderType = Constants.ORDER_TYPE_MARKET;
order2Params.Quantity = ScriptLotSize;
OrderMarginParams order3Params = new OrderMarginParams();
order3Params.Exchange = "NFO";
order3Params.TradingSymbol = CE_Buy_Symbol;
order3Params.TransactionType = Constants.TRANSACTION_TYPE_BUY;
order3Params.Variety = "regular";
order3Params.Product = Constants.PRODUCT_NRML;
order3Params.OrderType = Constants.ORDER_TYPE_MARKET;
order3Params.Quantity = ScriptLotSize;
OrderMarginParams order4Params = new OrderMarginParams();
order4Params.Exchange = "NFO";
order4Params.TradingSymbol = PE_Buy_Symbol;
order4Params.TransactionType = Constants.TRANSACTION_TYPE_BUY;
order4Params.Variety = "regular";
order4Params.Product = Constants.PRODUCT_NRML;
order4Params.OrderType = Constants.ORDER_TYPE_MARKET;
order4Params.Quantity = ScriptLotSize;
List ordersList = new List();
ordersList.Add(order3Params);
ordersList.Add(order4Params);
ordersList.Add(order1Params);
ordersList.Add(order2Params);
List MarginList = new List();
MarginList = kite.GetOrderMargins(ordersList);