A Bug in Kite API (C++ ) wiped off 3.125% off my capital today

nkr
nkr edited September 2023 in General
I am using C++ API to automate my trades. Today my algorithm ran for SENSEX and everything was going quite well till 1:00 PM. When market suddenly started rallying, my positions went in for a loss and just like a normal day, my algo tried to exit my positions. This is where all went wrong.

To place orders I place LIMIT orders by calculating the limit from LTP of the option. (https://support.zerodha.com/category/trading-and-markets/product-and-order-types/order/articles/how-to-use-limit-order-as-a-market-order) . Now in C++ client API, the price is declared as int. (I am not even kidding). Since it was expiry day and LTP was close to 0.90, the price calculated to exit my position was 0.05. Since the price is int, it got casted to 0 and exit order got rejected because, I quote "Limit orders placed at ₹0 are rejected on Kite." . My positions couldn't exit and at market close I noticed my losses.

Just tell me why the variable price should be of type int when you have double and float types available?

Thanks Zerodha.

@rakeshr @Imran @sujith
Tagged:
Sign In or Register to comment.