It looks like you're new here. If you want to get involved, click one of these buttons!
<?php
date_default_timezone_set("Asia/Kolkata");
$today=date('Y-m-d');
include_once "kiteconnect.php";
$market="MCX";
if(isset($_GET['market'])) $product =strtoupper($_GET['market']); // MCX or NSE by default MCX
$ordertype='LIMIT';
if(isset($_GET['ordertype'])) $ordertype=strtoupper($_GET['ordertype']); // LIMIT or MARKET by default LIMIT
$product='MIS';
if(isset($_GET['product'])) $product =strtoupper($_GET['product']); // MIS or NRML by default MIS
$orderid=$_GET['orderid'];
$price=$_GET['price'];
$lots=$_GET['lots'];
$script=$_GET['expiry'];
$trigger=$_GET['triggerprice'];
$apikey=$_GET['apikey'];
$accesscode=$_GET['accesscode'];
$kite = new KiteConnect($apikey);
try
{
$kite->setAccessToken($accesscode);
$kite->orderModify(170317000517096,null,
[
"tradingsymbol" => "CRUDEOILM17MARFUT",
"exchange" => "MCX",
"quantity" => 1,
"transaction_type" => "SELL",
"price" => 3110,
"trigger_price" => 3112,
"order_type" => "SL", // SL,SL-M, LIMIT, MARKET
"product" => "MIS" // MIS, MARKET
], "regular");
}
catch (Exception $e)
{
throw $e;
}
?>
-------------------------------------------------------
orderModify method accepts only three params and you seem to be passing four params, check out php documentation here.
public function orderModify($order_id, $parent_order_id=null, $params, $variety) {
$params["variety"] = $variety;
The above code is from kiteconnect.php file I have downloaded recently.
Lines #292, #293.
However, in the link you provided, there's no parent_order variable.
Order id is not sent in
$params
. We will fix the issue in next release but for now you can send$order_id
in params and it should work fine. Something like this Also note thatorder_id
should be sent as string not integer.