Trailing Stoploss not working or rarely working in BO

pivottrading.net
pivottrading.net edited November 2016 in General
Kailash/Vivek,

The problem of trailing stoploss still seems to exists.
I place around 200+ orders with trailing stoploss and stoploss.

But, trailing stoploss worked only for 1 order and for remaining orders, it didnt.
Stoploss values is not changing for the remaining one.

Trailing stoploss is one of the most important need for my strategies to work out.
Here is one order Id for you to debug into
BO order id: 161122000024857

And the order id for which it worked is
161122000024864

Below is the Url that was hit to place the above order. Similarly, all 200+ orders were sent using the same structure with different targets and stoploss.
Request Data: api_key=********&access_token=****************************&tradingsymbol=HDFCBANK&exchange=NSE&transaction_type=SELL&order_type=LIMIT&quantity=1&price=1202.8&squareoff_value=28.15&stoploss_value=5.95&trailing_stoploss=7&product=MIS&validity=DAY&tag=OHOLBASK\
Response Data: {"status": "success", "data": {"order_id": "161122000024864"}}

Can you please check and share your views.
  • sujith
    Hi Sourabh,

    Positions you are referring to are all in loss, So trialling will never come into picture. Checkout this to know more about bracket order http://zerodha.com/z-connect/tradezerodha/zerodha-trader-software-version/bracket-orders-trailing-stoploss-sl
  • pivottrading.net
    pivottrading.net edited November 2016
    Hey Sujith,

    I know that much basic that if position is in loss, the trailing stoploss does not come into picture.

    As per the bracket order and trailing SL concept, if the prices move in your trade direction, then the stoploss also keeps moving.

    My HDFC BANK was sold between 1198 to 1203. Check todays intraday charts for HDFCBank. It went from 1203 to 1189.35. and my trailing stoploss was somewhere between 2.5 - 7 rs for different order. So, when the price of stock went below 1203 untill 1189.35, the stoploss should have also get changed to new lows. But it didnt. All the stoploss remained at the same price.

    I have been using Kite connect API since day one. So, I know all its basic details. This issue has already been discussed with Kailash & Vivek 2 months before. They have already escalated this to OMensys.

    I was under impression, that it has been resolved by now. And it did worked for one of the orders today, but for remaining 200+ orders, trailing stoploss didnt worked. Thats what i wanted to bring to your notice so that it can be looked into.

    Hope this helps to do your further debugging.
    Thanks,
    Sourabh.
  • sujith
    Hi Sourabh,
    Can you give particular order's parent order id, stoploss and target order id for which you think stoploss trailing didn't work? We will check and get back to you.
  • pivottrading.net
    Hi Sujith,

    There are several orders. I am just sharing one order details for simplicity
    Reference numbers:

    BO Order ID: 161122000024855
    Child SL order ID: 161122000045885

    Request sent to zerodha using below url
    api_key=********&access_token=********&tradingsymbol=HDFCBANK&exchange=NSE&transaction_type=SELL&order_type=LIMIT&quantity=1&price=1198.9&squareoff_value=26.6&stoploss_value=9.85&trailing_stoploss=6.65&product=MIS&validity=DAY&tag=OHOLBASK
    Response:
    Response Data: {"status": "success", "data": {"order_id": "161122000024855"}}

    Order Execution Time : 9:30:05

    Hdfc Bank made a low of 1189.35. (at 10:50 am).

    Now, when first trade was done, initial SL was placed at 1198.9+9.85 = 1208.75.
    price fell by trailing stoploss amount (i.e 6.65). So, SL should get changed to 1208.75-6.65 = 1202.1
    But the SL never got changed from 1208.75 for the full day.

    Hope this will help to debug.

    Thanks,
    Sourabh.
  • Vivek
    @pivottrading.net We have identified the issue and it was caused when you send non integer value for stoploss. We have fixed this in our production version and you should be able to use it. Though we found few issues related OMS which throws invalid tick size for some values which we are in talks with them to get it fixed.
  • pivottrading.net
    @vivek By non-integer you mean the decimal values passed in stoploss was creating the problem ?

    Great to know that it has been fixed. Will run my algo again tommorow.

    Please confirm my above understanding.
  • sujith
    Hi Sourabh,

    You are right. Decimal values passed in stoploss was creating problem. Give it a try and let us know.
  • pivottrading.net
    Sure. Today, Algo didnt generated orders in large value scrips. Will do this tommorow and let u know.
  • pivottrading.net
    pivottrading.net edited November 2016
    Hey guys, have you blocked my BO. I am getting message, BO is not enabled in the product codes of RG****

    This wa working fine in the morning.
  • Vivek
    @pivottrading.net RMS team have informed that they had to lockdown BO for you since there were more than 1300 orders today in small quantites.
  • tahseen
    @sujith @Vivek So now can we place valid decimal based trailing stop losses ? Like 0.95 or 1.05 ?
  • sujith
    Hi @tahseen,
    The minimum value for trailing stop-loss is 1.
    You can give decimal value for trailing stop-loss but it has to be multiple of tick size.
  • tahseen
    Thanks @sujith

    Got it. Regarding tick am okay as I take care of it at my code level before I send any price or related value to Zerodha
  • sujith
    You need to send trailing stop-loss in points.
  • tahseen
    @sujith

    You mean in relative value like the way target and stop loss is correct ?
  • sujith
    Yes, you are right trailing stop-loss is a relative value.
Sign In or Register to comment.