Hi please check if my below code for placing BO order is correct or not from C#.net application kite.PlaceOrder("NSE", "INFY", "BUY", "400", null, "BO", "MARKET", "DAY", null, null, "30", "2", "2", "regular", ""); today is sunday. I am trying to execute order for testing purpose. it is not giving me any error but I am not able to see any order logging in kite application. I am able to download instruments so I hope my token not expired. Appreciate any help.
It will not throw an exception. Instead, PlaceOrder function will return the response from API as a dictionary. If the order is successful this will have the order id otherwise it will have the error information. In order to know the issue, it is better to look what is inside that dictionary. You can use this function to print it out to command line. It is better to collect the order ids of every PlaceOrder call for debugging purposes.
Thank you ajinasokan and vivek I shall post error here soon.one more query:for is there separate API for data feed?I need 1 min data for stocks.i am getting error invalid API.
Hi, Historical data API is not included in the base package. It is an add-on subscription. You can go to developers console > app details page and subscribe for the same.
Hi, Go to https://developers.kite.trade/login and then click on My apps and then go to Kite Connect app(SankarTrading) details page and on the right side there is a card with heading ADDONS. You can subscribe for historical data API there.
.i am able to place order.it is not bracket order that placed. Simultaneously not buy sell order placed. (both buy order placed)but why order rejection status is 'adapter is not ready'.Please refer my query.what is equivalent to placebracketorder() in java.in java there is Order order10 = kiteconnect.placeOrder(param10, "bo");
In dotnetkiteconnect library, PlaceOrder function accepts "Variety" parameter which can be "regular", "amo", "bo" or "co". By default, it is "regular". You can change this to "bo" place bracket order.
Error code 400 refers to errors from the client side. This happens probably due to incorrect parameters. To collect such errors you can directly print the return value of the PlaceOrder function like this:
Hi @ajinasokan ,@botany02 below code is working fine for me kite.PlaceOrder("NSE", "INFY", "BUY", "400", quote.LastPrice.ToString(),"MIS", "LIMIT", "DAY", null,null, "30", "2", "2", "regular", ""); but I wanted to place BO order what should be correct code for placing BO order? earlier sujith posted me java code but that is different I tried below one: kite.PlaceOrder("NSE", "INFY", "BUY", "400", quote.LastPrice.ToString(), "MIS", "LIMIT", "DAY", null, null, "30", "2", "2", "BO", "")) it is not working.I am getting below error: DEBUG: 404 {"status": "error", "message": "Route not found", "error_type": "GeneralException"}
{"status":"error","message":"Route not found","error_type":"GeneralException"} anyone able to place BO using dotnetkiteconnect please help.
It will not throw an exception. Instead, PlaceOrder function will return the response from API as a dictionary. If the order is successful this will have the order id otherwise it will have the error information. In order to know the issue, it is better to look what is inside that dictionary. You can use this function to print it out to command line. It is better to collect the order ids of every PlaceOrder call for debugging purposes.
Historical data API is not included in the base package. It is an add-on subscription. You can go to developers console > app details page and subscribe for the same.
Go to https://developers.kite.trade/login and then click on My apps and then go to Kite Connect app(SankarTrading) details page and on the right side there is a card with heading ADDONS. You can subscribe for historical data API there.
Refer java example to check if you are sending correct params.
In dotnetkiteconnect library, PlaceOrder function accepts "Variety" parameter which can be "regular", "amo", "bo" or "co". By default, it is "regular". You can change this to "bo" place bracket order.
What is the error message for that 400 response?
You need to catch the WebException to see the complete error response.
Post your complete code snippet,will be easy to debug.
Error code 400 refers to errors from the client side. This happens probably due to incorrect parameters. To collect such errors you can directly print the return value of the PlaceOrder function like this:
Console.WriteLine(JsonSerialize(kite.PlaceOrder( .... )))
In your code statement, BO orders should have "LIMIT" as OrderType and the price should not be null.
kite.PlaceOrder("NSE", "INFY", "BUY", "400", quote.LastPrice.ToString(),"MIS", "LIMIT", "DAY", null,null, "30", "2", "2", "regular", "");
but I wanted to place BO order
what should be correct code for placing BO order?
earlier sujith posted me java code but that is different
I tried below one:
kite.PlaceOrder("NSE", "INFY", "BUY", "400", quote.LastPrice.ToString(), "MIS", "LIMIT", "DAY", null, null, "30", "2", "2", "BO", ""))
it is not working.I am getting below error:
DEBUG: 404 {"status": "error", "message": "Route not found", "error_type": "GeneralException"}
{"status":"error","message":"Route not found","error_type":"GeneralException"}
anyone able to place BO using dotnetkiteconnect please help.
Variety parameter is in lower case. So it should be "bo" instead of "BO". Try
kite.PlaceOrder("NSE", "INFY", "BUY", "400", quote.LastPrice.ToString(),"MIS", "LIMIT", "DAY", null,null, "30", "2", "2", "bo", "");