Stoploss and Target for nrml order

vikasdawar
vikasdawar edited July 2020 in Java client
Hi,
I am trying to place a nrml order via kiteconnect API with a Stoploss of say -1 percent and target of 2 percent. however Once the order is executed i don't see any GTT order for Stoploss and Tararget. When I do it from website I don't see any issue. Using the following code
  OrderParams orderParams = new OrderParams();
orderParams.orderType = Constants.ORDER_TYPE_SL;

orderParams.tradingsymbol = tradingSymbol;
orderParams.quantity = quantity;
orderParams.price = price;
orderParams.transactionType = sideOfTrade.toUpperCase();

orderParams.exchange = Constants.EXCHANGE_NFO;
orderParams.product = product;
orderParams.validity = Constants.VALIDITY_DAY;

orderParams.triggerPrice = triggerPrice;
orderParams.stoploss = stopLoss;

orderParams.tag = tag; //tag is optional and it cannot be more than 8 characters and only alphanumeric is allowed

Order order = kiteConnect.placeOrder(orderParams, Constants.VARIETY_REGULAR);
  • sujith
    That feature is not available on Kite Connect yet. The trigger price and stop-loss values you are setting are for the stop-loss order and not GTT.
  • vikasdawar
    but stop loss does not gets set for that too.. once the order is triggered and trade gets placed i dont see any stop loss MIS order too .. for a stop loss order just trigger price and purchase prices are needed .. stop loss is for trigger another order once stop loss gets converted to a trade .. to rephrase the same .. stop losss order works only on trigger price and purchase price .. other than that there is no sense ..
  • sujith
    You seem to be confused between a regular stoploss order and bracket order.
  • vikasdawar
    i am aware of difference ... the point i wanted to emphasize in the order example i provided .. even if i dont provided stop loss it is working the same way (as after i provide the stoploss) .. so the stoploss is redundant for now ... however I got your point that GTT order for stoploss and target cant be placed as of now via kite connect ... correct me if I am missing something.
  • sujith
    Yes, Stop-loss and target GTT is not supported yet while placing orders.
    The trigger price in the order params is for stop-loss order's trigger price and the stop-loss field is for bracket order. Both the fields are used for different types of orders.
  • vikasdawar
    vikasdawar edited July 2020
    bhai isko support karwa do na GTT orders .. daily loss ho jata hai in its absence :smile:
  • sujith
    We are working on it. It might take a while. In the meanwhile, you can place GTT once your order gets executed. You can check out the documentation here.
  • vikasdawar
    (Please refer to thread above )

    Hi Sujith the problem is when I try placing exit orders for target and stop loss then I need extra margin for one of the exit order which is a bottleneck. When I place trade manually I dont require any extra margin. Now the margin becomes huge in case I am selling an option. For example if I buy a Nifty as nrml trade ... and choose stop loss and target manually I dont need any extra margin (the margin which is required to buy Nifty option is sufficent) .. however when I buy it programmetically and try placeing stop loss order and a target order then system asks for extra margin for one of the exit trade and amount is huge ...

    So just wanted to cross check by when would you be able to code for nrml order with stop loss and target as we can do in mannual trade.
    If there is any work around then please let me know.

    I hope my question is clear if not then please let me know.

    Thanks,
    Vikas
  • sujith
    You can place one OCO GTT, right?
    That doesn't work?
  • vikasdawar
    what is OCO gtt ? .....could you please send details ...
  • vikasdawar



    I want to emulate same order as attached programmatically .. please let me know how can it be achived without extra margin requirement compared to what is shown in the picture ..
  • sujith
    You can know more about GTT here.
Sign In or Register to comment.