Skip to content

Commit

Permalink
okex order_type default set value
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Sep 29, 2021
1 parent b3ec5e6 commit cd103ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Map/RequestTraderMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,17 @@ function buy(array $data){
case 'future':{
// 1:开多2:开空3:平多4:平空
$map['type']=$data['type'] ?? ($data['_entry']?1:4);
$map['order_type']=$data['order_type'] ?? 4;

//市价单与限价单的参数映射
if(isset($data['_number']) && isset($data['_price'])){
$map['match_price']=0;
$map['price']=$data['_price'];
$map['size']=$data['_number'] ?? 0;

$map['order_type']=$data['order_type'] ?? 0;
}else{
$map['match_price']=1;
$map['size']=$data['_number'] ?? 0;

$map['order_type']=$data['order_type'] ?? 4;
}

$map['leverage']=$data['leverage'] ?? 10;
Expand Down Expand Up @@ -339,16 +340,15 @@ function sell(array $data){
}
case 'future':{
$map['type']=$data['type'] ?? ($data['_entry']?2:3);
$map['order_type']=$data['order_type'] ?? 4;

//市价单与限价单的参数映射
if(isset($data['_number']) && isset($data['_price'])){
$map['match_price']=0;
$map['price']=$data['_price'];
$map['size']=$data['_number'] ?? 0;
$map['order_type']=$data['order_type'] ?? 0;
}else{
$map['match_price']=1;
$map['size']=$data['_number'] ?? 0;
$map['order_type']=$data['order_type'] ?? 4;
}

//判断是否是交割合约
Expand Down

0 comments on commit cd103ee

Please sign in to comment.