Skip to content

Commit

Permalink
MARKET quantity or quoteOrderQty
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Oct 28, 2021
1 parent cb3041f commit 29af4d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Map/RequestTraderMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,18 @@ function buy(array $data){
case 'binance':{
$map['symbol']=$data['_symbol'] ?? $data['symbol'];
$map['newClientOrderId']=$data['_client_id'] ?? ($data['newClientOrderId'] ?? '');
$map['quantity']=$data['_number'] ?? ($data['quantity'] ?? '');
$map['side']='BUY';

if(empty($map['newClientOrderId'])) unset($map['newClientOrderId']);

//市价单与限价单的参数映射
if(isset($data['_number']) && isset($data['_price'])){
$map['quantity']=$data['_number'] ?? ($data['quantity'] ?? '');
$map['timeInForce']=$data['timeInForce'] ?? 'GTC';
$map['price']=$data['_price'] ?? ($data['price'] ?? '');
$map['type']='LIMIT';
}else{
$map['quoteOrderQty']=$data['_number'] ?? ($data['quoteOrderQty'] ?? '');
$map['type']='MARKET';
}

Expand Down

0 comments on commit 29af4d7

Please sign in to comment.