Today I got error when sending stop loss orders in stock futures 2 example orders RBLBANK22OCTFUT - Trigger price for stoploss buy orders should be higher than the last traded price (114.40) MOTHERSON22OCTFUT - Trigger price for stoploss sell orders should be lower than the last traded price (72.90) Reference price given by error is actually pdc instead of any price after open.
Further, this error has always irritated me. I do not understand why Zerodha needs to have this extra layer of check rather than passing it on to exchange. You cannot always keep up with exchange ltp. So ltp used to compare can be stale. When there are issues it can be too stale, and we get such errors. On top of that, transactions can be slow in stock futures. So sometimes ltp is stale even in exchange while bid ask has moved. So comparing ltp for trigger price is faulty in concept. It might make sense to do this in GUI as warning but still there should be option to ignore. In apis, you have to assume that caller knows what he is doing and if it's a mistake, code can be fixed. Please think about this.