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 28, 2021
1 parent 16ceaaf commit b3ec5e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Map/RequestTraderMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ function buy(array $data){
case 'okex':{
$map['client_oid']=$data['_client_id'] ?? ($data['client_oid'] ?? '');
$map['instrument_id']=$data['_symbol'] ?? $data['instrument_id'];
$map['order_type']=$data['order_type'] ?? 0;

switch ($this->checkType($map['instrument_id'])){
case 'spot':{
$data['side']=$map['side']='buy';
$map['margin_trading']=1;
$map['order_type']=$data['order_type'] ?? 0;

//市价单与限价单的参数映射
if(isset($data['_number']) && isset($data['_price'])){
Expand All @@ -127,6 +127,7 @@ 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'])){
Expand Down Expand Up @@ -310,12 +311,12 @@ function sell(array $data){
case 'okex':{
$map['client_oid']=$data['_client_id'] ?? ($data['client_oid'] ?? '');
$map['instrument_id']=$data['_symbol'] ?? $data['instrument_id'];
$map['order_type']=$data['order_type'] ?? 0;

switch ($this->checkType($map['instrument_id'])){
case 'spot':{
$data['side']=$map['side']='sell';
$map['margin_trading']=1;
$map['order_type']=$data['order_type'] ?? 0;

//市价单与限价单的参数映射
if(isset($data['_number']) && isset($data['_price'])){
Expand All @@ -338,6 +339,7 @@ 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'])){
Expand Down

0 comments on commit b3ec5e6

Please sign in to comment.