Query regarding Trailing Stop Loss

Hello,

I have some questions regarding Fyers API V3.

Let’s take an example. I want to put a buy order for NSE:BANKNIFTY2441048600CE. I want to buy this only if the LTP is above 355.

  1. Is this limit order correct?

data = {

"symbol":"NSE:BANKNIFTY2441048600CE",

"qty":1,

"type":1,

"side":1,

"productType":"INTRADAY",

"limitPrice":355.00,

"stopPrice":0,

"validity":"DAY",

"disclosedQty":0,

"offlineOrder":False }
  1. If I put Qty 1 in the above example: I get an error that 1 is not the minimum lot size. Is there any way I can calculate the lot size?

  2. I want to put trailing stop loss. Is there any way fyers take trailing stop loss orders?

3.a) If no, there i write a logic in python. What type of order should I put: CO? Can you please give me an example? Let’s say i want to put trailing stop loss (LTP - 30). How should I put these orders in the system and keep on modifying them?

Thanks & Regards,

Sudeep

  • Yes, you place a limit order @355/-, only if sellers are there at the given price it gets triggered. ie; if LTP crosses 355 then your order gets triggered.

  • You need to mention lot sizes in your program, Please check the changes to lot sizes after APR series.

  • API doesn’t provide trailing SL, you need to manually update it.

  • If a fresh order, go with CO and update the SL with time, to mimick trailing SL. Else stick with the classic SL Limit order and keep updating SL limit price with time.

Thank you!

For CO, can you please fill this as I am having hard time to understand what values I need to push for limit price and stop price for CO:
data = {

“symbol”:“NSE:BANKNIFTY2441048600CE”,

“qty”:1,

“type”:1,

“side”:1,

“productType”:“CO”,

“limitPrice”:0,

“stopPrice”:0,

“validity”:“DAY”,

“disclosedQty”:0,

“offlineOrder”:False }

Regards,

https://myapi.fyers.in/docsv3#tag/Order-Placement-Guide/Product-Types

Yes I read this but I am having hardtime. I am getting an error like {‘code’: -50, ‘message’: ‘StopLoss not a multiple of tick size 0.0250’, ‘s’: ‘error’}. That’s why I asked you if you could help me fille the above data {…}, I will try to pass it.

Thanks

Hey @108942866728835058839

  • The limit order can be placed at any price below the current LTP , the way you have mentioned
  • The lot size should be mentioned from you’re end , the key for lot sizes is mentioned in the docs .
    https://myapi.fyers.in/docsv3#tag/Broker-Config/paths/~1Broker%20Config/patch
  • We don’t provide trailing SL,
    If you’re creating a new position you can place a CO order and modify the SL whenever required time.