zhouaini528 / binance-php

Binance API Like the official document interface, Support for arbitrary extension.
MIT License
107 stars 43 forks source link

postOrderOco not working #39

Closed hk743kfjw closed 1 year ago

hk743kfjw commented 2 years ago

Hi, sorry for bothering you, but OCO order not placing. It returns Error -1104 (Not all sent parameters were read; read '9' parameter(s) but was sent '11') Other orders are placing well.

//New OCO (TRADE)
try {
    $result=$binance->trade()->postOrderOco([
        'symbol'=>'LTCBTC',
        'side'=>'SELL',
        'type'=>'LIMIT',
        'quantity'=>'0.1',
        'price'=>'200',
        'stopPrice'=>'0.1',
        'timeInForce'=>'GTC',
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r(json_decode($e->getMessage(),true));
}

As well as this this command has no any effect for setting custom options.

$binance->setOptions([
    //Set the request timeout to 60 seconds by default
    'timeout'=>10,
]);

Could you check it?

hk743kfjw commented 2 years ago

SOLVED The problem was in parameters I send to exchange. timeInForce and type the parameters must be excluded from query.