Hi,
I am getting the following error while login using JAVA API.
Cannot invoke "com.angelbroking.smartapi.models.User.getFeedToken()" because "user" is null
Please help me to resolve.
Hi,
I am getting the following error while login using JAVA API.
Cannot invoke "com.angelbroking.smartapi.models.User.getFeedToken()" because "user" is null
Please help me to resolve.
@admin Appreciate your reply but I solved it by myself.
I made the following changes in source code and rebuilt the jar.
-in SmartConnect.java I added the trigger price in JSONObject params which will be sent via order post request
if (orderParams.triggerprice != null)
params.put("triggerprice", orderParams.triggerprice);
Now I am able to place stoploss order and I can also use triggerprice along with the order
@admin not getting any errors. I tried with multiple combination but unable to place stop loss order. Limit orders are fine. And I am unable to find trigger price also in orderparams.
When I was checking this market was at 358 range and I wanted to buy if the price moves above 362. I know I can place a limit order if the price matches my price, but I want to keep the order ready with trigger price.
Hi,
I am unable to place stop loss order, can someone please help ? Below is the order parameters I am trying with -
OrderParams orderParams = new OrderParams();
orderParams.variety = "STOPLOSS";
orderParams.quantity = 1;
orderParams.symboltoken = "3045";
orderParams.exchange = Constants.EXCHANGE_NSE;
orderParams.ordertype = Constants.ORDER_TYPE_SL;
orderParams.stoploss = "362";
orderParams.tradingsymbol = "SBIN-EQ";
orderParams.producttype = Constants.PRODUCT_INTRADAY;
orderParams.duration = Constants.VALIDITY_DAY;
orderParams.transactiontype = Constants.TRANSACTION_TYPE_BUY;
orderParams.price = (double) 362;
orderParams.squareoff = "0";
Order order = smartConnect.placeOrder(orderParams, Constants.VARIETY_REGULAR);