I am using below code snippet for placing order. My expectation is, below code snippet it will place intraday order with Target (exit price) & stop loss but this is not reality.
I am selecting API parameters as per zerodha manual trade. Please find attached screenshot.
I am going to use below code snippet for placing a buy order, stop loss and target price. Could you verify and feel free to correct if anything wrong (I'm new to API trading hope you don't mind).
stoploss
field is only used for bracket order.You need to place a stoploss limit order with price and trigger price.
I am going to use below code snippet for placing a buy order, stop loss and target price. Could you verify and feel free to correct if anything wrong (I'm new to API trading hope you don't mind).
#Place Order
order_id = kite.place_order(tradingsymbol = 'TATAMOTORS',
exchange = 'NSE',
transaction_type = 'BUY',
quantity = 1,
product = 'MIS',
variety = 'regular',
order_type = 'LIMIT',
price = 296.4)
#Stop Loss
sl_order_id = kite.place_order(tradingsymbol = 'TATAMOTORS',
exchange = 'NSE',
transaction_type = 'SELL',
quantity = 1,
product = 'MIS',
variety = 'regular',
order_type = 'SL',
trigger_price = 292.4,
stoploss = 293.4)
#target_order
exit_order_id = kite.place_order(tradingsymbol = 'TATAMOTORS',
exchange = 'NSE',
transaction_type = 'BUY',
quantity = 1,
product = 'MIS',
variety = 'regular',
order_type = 'LIMIT',
price = 298.4)
The limit orders seem fine, you will have to remove
stoploss
from SL order and useprice
.