Skip to main content
Question
FYERS API
Asked a question 8 months ago

Unable to place stoploss order through API I am unable to place stoploss order using API. See the data details below and comment on way forward. Algo Output: ----------------------------------------------------------------- SBIN-EQ Market Depth API Response ===> {'s': 'ok', 'd': {'NSE:SBIN-EQ': {'totalbuyqty': 0, 'totalsellqty': 0, 'bids': [], 'ask': [], 'o': 536.25, 'h': 537.7, 'l': 527.1, 'c': 540.55, 'chp': -2.03, 'ch': -10.95, 'ltq': 0, 'ltt': 0, 'ltp': 529.6, 'v': 0, 'lower_ckt': 476.65, 'upper_ckt': 582.55, 'expiry': '', 'oi': 0, 'oiflag': False, 'pdoi': 0, 'oipercent': 0.0}}, 'message': ''} ------------------------------------------------------------------------------------ placeOrder data ===> {'symbol': 'NSE:SBIN-EQ', 'qty': 1, 'type': 1, 'side': 1, 'productType': 'INTRADAY', 'limitPrice': 487.25, 'stopPrice': 0, 'validity': 'IOC', 'disclosedQty': 0, 'offlineOrder': 'True', 'stopLoss': 0, 'takeProfit': 0} placeOrder Response ===> {'s': 'ok', 'code': 1101, 'message': 'Order Submitted Successfully. Your Order Ref. No.52202127512', 'id': '52202127512'} -------------------------------------------------------------------------------------- Status: I see a order '52202127512' in orderbook, with 'limitPrice': 487.25 ===> All Good -------------------------------------------------------------------------------------- Stoploss Order data ===> {'symbol': 'NSE:SBIN-EQ', 'qty': 1, 'type': 1, 'side': -1, 'productType': 'INTRADAY', 'limitPrice': 540, 'stopPrice': 510.0, 'validity': 'IOC', 'disclosedQty': 0, 'offlineOrder': 'True', 'stopLoss': 0, 'takeProfit': 0} Stoploss Order Response ===> {'s': 'error', 'code': -390, 'message': 'Please provide a valid stop price', 'id': ''} -------------------------------------------------------------------------------------- Status: error - why ??? -------------------------------------------------------------------------------------- Stoploss Order data ===> {'symbol': 'NSE:SBIN-EQ', 'qty': 1, 'type': 1, 'side': -1, 'productType': 'INTRADAY', 'limitPrice': 540, 'stopPrice': 0, 'validity': 'IOC', 'disclosedQty': 0, 'offlineOrder': 'True', 'stopLoss': 510, 'takeProfit': 0} Stoploss Order Response ===> {'s': 'ok', 'code': 1101, 'message': 'Order Submitted Successfully. Your Order Ref. No.52202127531', 'id': '52202127531'} -------------------------------------------------------------------------------------- Status: ok if I use 'stopLoss' then API call is executed successfully. However in 'OrderBook', I see a 'Sell Order' with 'limitPrice': 540 and 'S/LTrigg' field is blank ??? --------------------------------------------------------------------------------------

Join FYERS Community to pick others' brains on Trading/Investing

Hi Manoj,
Can you check now if you are still facing the issue?