• 09-12-2021, 14:29:45
    #1
    Merhabalar jaggedsoft binance api yazılımında şöyle bir fonksiyon var fakat kullanamıyorum.
    Fonksiyon mu hatalı yoksa ben mi hatalı istek gönderiyorum anlamadım.

    https://binance-docs.github.io/apido...#new-oco-trade

        public function ocoOrder(string $side, string $symbol, $quantity, $price, $stopprice, $stoplimitprice = null, $stoplimittimeinforce = 'GTC', array $flags = [])
        {
            $opt = [
                "symbol" => $symbol,
                "side" => $side,
            ];
        
            if (is_numeric($quantity) === false) {
                $error = "Parameter quantity expected numeric for ' $side . ' ' . $symbol .', got " . gettype($quantity);
                trigger_error($error, E_USER_ERROR);
            } else {
                $opt['quantity'] = $quantity;
            }
    
            if (is_numeric($price) === false) {
                $error = "Parameter price expected numeric for ' $side . ' ' . $symbol .', got " . gettype($price);
                trigger_error($error, E_USER_ERROR);
            } else {
                $opt['price'] = $price;
            }
    
            if (is_numeric($stopprice) === false) {
                $error = "Parameter stopprice expected numeric for ' $side . ' ' . $symbol .', got " . gettype($stopprice);
                trigger_error($error, E_USER_ERROR);
            } else {
                $opt['stopprice'] = $stopprice;
            }
    
            if (is_null($stoplimitprice) === false && empty($stoplimitprice) === false) {
                $opt['stopLimitPrice'] = $stoplimitprice;
                if ( ($stoplimittimeinforce == 'FOK') || ($stoplimittimeinforce == 'IOC') ) {
                    $opt['stopLimitTimeInForce'] = $stoplimittimeinforce;
                } else {
                    $opt['stopLimitTimeInForce'] = 'GTC'; // `Good 'till cancel`. Needed if flag `stopLimitPrice` used.
                }
            }
    
            // Check other flags
            foreach (array('icebergQty','stopIcebergQty','listClientOrderId','limitClientOrderId','stopClientOrderId','newOrderRespType') as $flag) {
                if ( isset($flags[$flag]) && !empty($flags[$flag]) )
                    $opt[$flag] = $flags[$flag];
            }
    
            return $this->httpRequest("v3/order/oco", "POST", $opt, true);
        }
  • 09-12-2021, 22:33:08
    #2
    Mesaj olarak ne dönüyor. PHP hatası vs alıyor musunuz?
  • 09-12-2021, 22:51:42
    #3
    QuarkChain adlı üyeden alıntı: mesajı görüntüle
    Mesaj olarak ne dönüyor. PHP hatası vs alıyor musunuz?
    Merhaba dönüş kodu bu
    Symbol side quantity price stopprice stoplimitprice ve timestamp göndermeme rağmen aynı hatayı veriyor acaba fonksiyonmu bozuk.
  • 09-12-2021, 23:20:15
    #4
    Kendim test edip sonucu söyleyeceğim.
  • 09-12-2021, 23:45:46
    #5
    BNB'yi deneyerek OCO sipariş oluşturabildim. Sizin gönderdiğiniz istek ne şekilde acaba?
    <?php
    $api->ocoOrder("buy", "BNBUSDT", 1, 500, 590, 590);
  • 10-12-2021, 00:14:14
    #6
    QuarkChain adlı üyeden alıntı: mesajı görüntüle
    BNB'yi deneyerek OCO sipariş oluşturabildim. Sizin gönderdiğiniz istek ne şekilde acaba?
    <?php
    $api->ocoOrder("buy", "BNBUSDT", 1, 500, 590, 590);

    garip bir şekilde böyle gönderince çalıştı teşekkür ederim.