Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Order #5

Open
Mert-coderoid opened this issue Jun 19, 2022 · 0 comments
Open

New Order #5

Mert-coderoid opened this issue Jun 19, 2022 · 0 comments

Comments

@Mert-coderoid
Copy link

Mert-coderoid commented Jun 19, 2022

Hello I need to create new order function with your class.
I tried that but its not work for me

`
/**
* Create a new order.
*
* @throws Exception
*
* @param string $symbol Exchange Pair Symbol
* @param string $side Order side (BUY or SELL)
* @param string $type Order type (LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT, LIMIT_MAKER)
* @param string $timeInForce (GTC, IOC)
* @param float $quantity Order quantity
* @param float $price Order price
* @param float $stopPrice (for STOP_LOSS and TAKE_PROFIT orders)
* @param float $icebergQty (for LIMIT orders)
* @param float $newOrderResprice (for STOP_LOSS and TAKE_PROFIT orders)
* @param float $newOrderResptime (for STOP_LOSS and TAKE_PROFIT orders)
* @param string $recvWindow (optional)
* @param string $timing (optional)
*
* @return mixed
*/
// public function createOrder($symbol, $side, $type, $timeInForce, $quantity, $price, $stopPrice = null, $icebergQty = null, $newOrderResprice = null, $newOrderResptime = null, $recvWindow = null, $timing = null)
public function createOrder()
{
$data = [
// 'symbol' => $symbol ? strtoupper($symbol) : null,
// 'side' => $side ? strtoupper($side) : null,
// 'type' => $type ? strtoupper($type) : null,
// 'timeInForce' => $timeInForce ? strtoupper($timeInForce) : null,
// 'quantity' => $quantity ? $quantity : null,
// 'price' => $price ? $price : null,
// 'stopPrice' => $stopPrice ? $stopPrice : null,
// 'icebergQty' => $icebergQty ? $icebergQty : null,
// 'newOrderResprice' => $newOrderResprice ? $newOrderResprice : null,
// 'newOrderResptime' => $newOrderResptime ? $newOrderResptime : null,
// 'recvWindow' => $recvWindow ? $recvWindow : $this->recvWindow,
// 'timestamp' => $this->milliseconds(),

          'symbol' => 'BNBUSDT',
          'side' => 'BUY',
          'type' => 'LIMIT',
          'timeInForce' => 'GTC',
          'quantity' => "1",
          'price' => "41",
      ];

      $response = $this->privateRequest('v3/order', $data, 'POST');

      return $response;
  }

error is :
array:3 [▼
"code" => "-1104"
"error" => "INVALID_REQUEST"
"message" => "Not all sent parameters were read; read 1 parameter(s) but was sent 2."
]
`
Can you help me about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant