Skip to content

Commit

Permalink
update the order
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Mar 28, 2019
1 parent 4a47f73 commit 34d9388
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Api/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ public function getAll(array $data){
}

public function put(array $data){
$this->type='PUT';
$this->path='/api/v1/order';
$this->data=$data;

return $this->exec();
}

/**
Expand Down
13 changes: 13 additions & 0 deletions tests/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@
print_r(json_decode($e->getMessage(),true));
}

//update the order
try {
$result=$bitmex->order()->put([
'symbol'=>'XBTUSD',
'orderID'=>$result['orderID'],
'price'=>'200',
'orderQty'=>'2',
]);
print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
}

//cancellation of order
try {
$result=$bitmex->order()->delete([
Expand Down

0 comments on commit 34d9388

Please sign in to comment.