Trailing stoploss not working as expected

Newtrade
Hello team!

I noticed today that the trailing stoploss functionality isn't working as expected. I use a target of 5, stoploss of 7 and trailing as 2

Now this is what i noticed today...I executed the below trade:

13:03:13 - BO Buy CEATLTD @ 1773.6 (Order ID 170601000545738)
My stop loss is at 1766.6 (Order ID 170601000545741)
My target is at 1778.60 (Order ID 170601000545740)

I keep watching the chart and see the price went to 1777.8 @ 13:19:00. At this point i expected my stoploss trigger at be at 1774.6. But this was not the case!!! Eventually the price dropped and it got triggered at 1769.5 and sold at 1768.

Can someone explain to me why this is happening? Is there something i'm not following about Kite connect or is there an existing issue with trailing stop losses?

Regards,

PS: I'm forced to use integers and i hope you guys understand the strategy constraints that come with such limitations... Not just this, now you add the additional cost to squareoff open positions !!! Makes no logical sense for API customers to pay that in addition to the 24k a year...
  • Matti
    @Newtrade Can you tell me what was the trailing value you'd given? If you entered at 1773.6 with an SL o f1766.6, when the price of CEAT is at 1777.8, one could expect the SL to be at 1770.6. I'm not sure how it could be at 1774.6. In any case, this seems to have worked fine based on what I would expect to be normal behaviour for a bracket order.

    Also, regarding the square-off charge; this is more a means of dissuading users from keeping positions open for the RMS system to square-off instead of doing it themselves. One has time up to 3:20 to do this and avoid the charge. This is done because at 3:20, we'd have to send thousands of orders to the OMS for squaring off these positions. This puts a load on the system that brings a lag in performance for everyone in the system.
  • Newtrade
    Newtrade edited June 2017
    @Nikhil.A Thank you for the reply, My trailing value is set to 2 in the code i use (as below)

    Method used is:
    public string PlaceBO(
    string Exch,
    string TrdSym,
    string Trans,
    int Qty,
    double LmtPrice,
    double SqOffValue,
    double StoplossValue,
    double TrailValue = 0
    )

    In my code
    OrderId = kiteobject.PlaceBO(kiteobject.Exchange.NSE, symbol, Trans, 1, ltp, 5, 7, 2);

    So we ltp moves from 1773.6 to 1777.8, my understanding is that the stoploss trigger would now be at 1766.6 + 2*(1777.8-1773.6) -> taking the integer giving 1774.6. It would be at 1770.6 if my trail value was 1.

    Please let me know if my understand in wrong? My assumption is that if i set trail value as 2, then for every 1 increase in price (in my direction) my stoploss trigger is increase by 2.

    As for the square-off charges, its not about the charges perse but the additional effort needed to code the "close all open" positions. But you're reasons are valid, anyhow i am sure there soon will be a point in time where you wont charge for the API as retail involvement picks up and having API access is kind of a no brainer for brokers. The focus in my opinion should always be on retention cause CLV is the only thing that matters and retention is THE factor that hurts competitors.

    You would just have to pull up the average brokerage from clients who use the API and compare it with the clients who dont. You would then want a higher % of users to be exposed to API's :smiley: )

    Regards,
  • Newtrade
    Any suggestions for the trailing issues?
  • Matti
    @Newtrade That's not how it works, I'm afraid. If your trailing value is set at 2, that means that the SL will trail the price on every 2 rupees BY 2 rupees. So, the 'bracket' size remains the same, i.e., the difference between the target and stoploss remains the same.
  • Newtrade
    @Nikhil.A Thank you for the clarification
This discussion has been closed.