Trailing stop loss not getting triggered

Srik
Hi,

Below is how I called the API:

order_place(exchange = 'NSE',
tradingsymbol = RCOM,
transaction_type = 'BUY',
quantity = 44,
price = 19.6,
product = 'MIS',
order_type = 'LIMIT',
validity = 'DAY',
trigger_price = '0',
disclosed_quantity = None,
squareoff_value=20.8,
stoploss_value=1.5,
trailing_stoploss= 0.1,
variety="bo"
)

Stock price went up to 19.85. In between it was traded at 19.75, 19.7. Then it went down to 19.65 and got sold. My question is why didn't it get sold at its trailing stoploss value of 0.1. i.e somewhere above 19.83. What is wrong my my API call?

Regards,
Srikanth
  • sujith
    Hi @Srik ,
    Are you expecting stop-loss as 18.1 and target as 40.4 ?
    You need to give points to square off and stop-loss values. Points are basically the difference between target and price, same for stop-loss also.
    The minimum value for trailing stop-loss is 1.
  • Srik
    Hi Sujith,

    I'm expecting stop-loss as 18.1 and target as 20.8. Also trailing stop-loss to be 0.1.
    i.e. when the price goes to 19.7 from 19.6 my stop-loss should be moved to 18.2 from 18.1. Can you please help me understand the values to be given to the API with this as example.

    Regards,
    Srikanth
  • sujith
    Hi @Srik,
    For your scenario params will be something like,

    order_place(exchange = 'NSE',
    tradingsymbol = RCOM,
    transaction_type = 'BUY',
    quantity = 44,
    price = 19.6,
    product = 'MIS',
    order_type = 'LIMIT',
    validity = 'DAY',
    trigger_price = '0',
    disclosed_quantity = None,
    squareoff_value=1.2,
    stoploss_value=18.1,
    trailing_stoploss= 1,
    variety="bo"
    )

    Please note the following constraints,
    1. If the stop-loss value you provide goes below lower circuit then it will be set to lower circuit value.
    2. If the square-off value goes above upper circuit then it will be set to upper circuit value.
    3. All the points you define must be multiple of tick size for square-off, stop-loss and trailing stop-loss.
    4. The minimum value for trailing stop-loss is 1. You can't set the trailing stop-loss value below 1.
Sign In or Register to comment.