@sujith Now find one new case on order placing by using $kite->placeOrder function; nothing is return. Order is placed correctly and reflected at the zerodha order listing as a complete; but order id is not returned and even after that none script is working.
After placing first order, order is placed correctly at zerodha but no order id is returned and also the second order is not placed i.e. not replicated at the zerodha.
@sachinstlko09 The error was because you were trying to use Json object as array in $order_id.You need to first convert Json object to array and then retrieve order_id. As below:
$order_id = $kite->placeOrder("regular", [ "tradingsymbol" => "SBIN", "exchange" => "NSE", "quantity" => "1", "transaction_type" => "BUY", "order_type" => "MARKET", "product" => "MIS" ]); $order_id = json_decode(json_encode($order_id), True)['order_id']; echo "SBIN Order id is ".$order_id; // Place order. $order_id = $kite->placeOrder("regular", [ "tradingsymbol" => "INFY", "exchange" => "NSE", "quantity" => 1, "transaction_type" => "BUY", "order_type" => "MARKET", "product" => "CNC" ]); $order_id = json_decode(json_encode($order_id), True)['order_id']; echo "INFY Order id is ".$order_id;
You might be exceeding rate limit, check rate limit here.
Please response ASAP.
For some case two order can be placed simultaneously.
After placing first order, order is placed correctly at zerodha but no order id is returned and also the second order is not placed i.e. not replicated at the zerodha.
$kite = new KiteConnect($api_key);
$kite->setAccessToken($access_token);
$historical_data = $kite->getHistoricalData($instrument_token, $interval, $from, $to);
$order_id = $kite->placeOrder("regular", [
"tradingsymbol" => "SBIN",
"exchange" => "NSE",
"quantity" => "1",
"transaction_type" => "BUY",
"order_type" => "MARKET",
"product" => "MIS"
])["order_id"];
$order_id = $kite->placeOrder("regular", [
"tradingsymbol" => "SBIN",
"exchange" => "NSE",
"quantity" => "1",
"transaction_type" => "SELL",
"order_type" => "MARKET",
"product" => "MIS"
])["order_id"];
The error was because you were trying to use Json object as array in $order_id.You need to first convert Json object to array and then retrieve order_id. As below:
Next order execution was skipped because of error occurrence in the above line of fetching order_id. You can go through the above code.
$order_id = $kite->placeOrder("regular", [
"tradingsymbol" => "SBIN",
"exchange" => "NSE",
"quantity" => "1",
"transaction_type" => "BUY",
"order_type" => "MARKET",
"product" => "MIS"
]);
$order_id = json_decode(json_encode($order_id), True)['order_id'];
Nothing work after placing the order.
What is the error/exception you are getting? Can you paste error output here?
This forum is dedicated only for Kite Connect related queries. We don't provide support for programming.