connect.placeOrder returns error
-
I tried to place order using c# library but got
internal error code: AB2001, status: false, data: null.below is my code:
OrderInfo sord = new OrderInfo(); sord.variety = Constants.VARIETY_NORMAL; sord.tradingsymbol = "NIFTY08JUL2115900CE"; sord.symboltoken = "39504"; sord.transactiontype = Constants.TRANSACTION_TYPE_BUY; sord.exchange = Constants.EXCHANGE_NFO; sord.ordertype = Constants.ORDER_TYPE_MARKET; sord.producttype = Constants.PRODUCT_TYPE_CARRYFORWARD; sord.duration = Constants.VALIDITY_DAY; sord.price = "0"; sord.squareoff = "0"; sord.stoploss = "0"; sord.quantity = "1"; obj = connect.placeOrder(sord); OrderResponse sOres = obj.PlaceOrderResponse;
please correct me if anything wrong
-
@redmouseindia
Ok Thanks buddy -
@asksameer I am calling sdk in c# desktop application (UWP App)
-
Are you calling angel api / sdk in C# Console application OR Web application?
-
HI @redmouseindia ok.
-
@redmouseindia
Fixed.Modified code as mentioned below:
orderid and triggerprice properties of OrderInfo class returns NULL, So I created a new class named PlaceOrderInfo class removing orderid, triggerprice, stoploss and squareoff properties. Also I have mentioned Quantity as 75 instead of 1.Thank you.
-
@admin Its a market order, so i have mentioned price as ZERO
-
HI @redmouseindia At what price you want to execute this order.