The Official .Net library for communicating with the Alice Blue APIs.
Alice Blue .Net library provides an easy to use wrapper over the HTTPS APIs.
The HTTP calls have been converted to methods and JSON responses are wrapped into .Net-compatible objects.
- Author: CodiFi
NuGet\Install-Package a3net -Version 1.1.1
Using NuGet Execute in Tools » NuGet Package Manager » Package Manager Console
NuGet\Install-Package a3net -Version 1.1.1
a3net Library Connect the .NET Core 2.0.
using a3net;
There is AliceBlue in the whole library: AliceBlue
. The session_ID
static method is used to retrieve a Session ID from the alice blue server. A Session ID is valid until the trading account logout.
With a Session ID, you can instantiate an AliceBlue object. Ideally you only need to create a Session ID once every time login the trading account with password. After you have the Session ID, you can store it
separately for re-use.
- You can create an AliceBlue object with your
UserID
andAPI Key
andlog
.
AliceBlue Alice = new AliceBlue();
- You can get a Session ID by running following command. Store it once a day. The API_Key available from Trading Application.
string User_ID = "User_ID";
string API_Key = "API_Key";
Boolean log = true;
Console.WriteLine("The session :" + Alice.session_ID(User_ID, API_Key, log));
Console.WriteLine("The Holdings :" + Alice.Holdings());
Console.WriteLine("The Trade_book :" + Alice.Trade_book());
Console.WriteLine("The Fund :" + Alice.Funds());
Console.WriteLine("The profile :" + Alice.Profile());
Console.WriteLine("The order_book :" + Alice.Order_Book());
string ret = "DAY";
Console.WriteLine("The position_book :" + Alice.Position_book(ret));
string nestOrderNumber = "220923000197349";
Console.WriteLine("The Order_histroy :" + Alice.Order_Histroy(nestOrderNumber));
string exch = "MCX";
string trading_symbol = "CRUDEOILM19JULFUT";
string nestOrderNumber = "221012000081870";
Console.WriteLine("The Cancle_Order :" + Alice.Cancel_Order(exch, nestOrderNumber, trading_symbol));
string token= "1594";
string resolution = "D";
string from = "1660128489000";
string to = "1660221861000";
string exchange = "NSE";
Console.WriteLine("The Historical_Data :" + Alice.Historical_Data(token,resolution,from,to,exchange));
complexty include bracket orders or OCO (One Cancels the Other), cover orders and After Market Orders
string complexty = "regular";
string discqty = "0";
string exch = "NSE";
string pcode = "cnc";
string prctyp = "l";
string price = "520.0";
string qty = "1";
string ret = "DAY";
string symbol_id = "3045";
string transtype = "buy";
string trigprice = "";
string ordertag = "order1";
string trading_symbol = "SBIN-EQ";
Console.WriteLine("the PlaceOrder:" + Alice.Place_Order(complexty, discqty, exch, pcode, prctyp, price, qty, ret, symbol_id, trading_symbol, transtype, trigprice, ordertag));
string transtype = "buy";
string discqty = "0";
string exch = "nse";
string trading_symbol = "sbin-eq";
string nestOrderNumber = "221012000081870";
string prctyp = "l";
string price = "520.0";
string qty = "1";
string trigprice = "";
string filledquantity = "0";
Console.WriteLine("The Modify_Order:" + Alice.Modify_Order(transtype,discqty, exch, trading_symbol, nestOrderNumber, prctyp, price, qty,trigPrice, filledQuantity));
Here is an example of what I'm expecting while you are creating an issue.```