Hello, I am unable to execute the following TRAILING_STOP_MARKET order… because of error
[code] =>
-4136 [msg] => Target strategy invalid for orderType TRAILING_STOP_MARKET,closePosition true )
// TRAILING_STOP_MARKET <-----------------------------------------------------
$response = binance::call(’/fapi/v1/order’, [
‘symbol’=> $key_pair,
‘side’=> ‘SELL’,
‘positionSide’=> ‘BOTH’,
‘type’=> ‘TRAILING_STOP_MARKET’,
‘activationPrice’=> $take_profit_price,
‘callbackRate’=> 0.3,
‘closePosition’=> ‘TRUE’,
‘timeInForce’=> ‘GTC’,
‘workingType’=> ‘CONTRACT_PRICE’,
‘priceProtect’=> ‘TRUE’
], ‘POST’);
print_r($response);
(However the other orders all execute successfully onto exchange, with same underlying code eg.)
_______________________________________________________________-
$response = binance::call(’/fapi/v1/order’, [
‘symbol’=> $key_pair,
‘side’=> ‘BUY’,
‘positionSide’=> ‘BOTH’,
‘type’=> ‘MARKET’,
‘quantity’=> $quantity,
], ‘POST’);
print_r($response); //
$response = binance::call(’/fapi/v1/order’, [
‘symbol’=> $key_pair,
‘side’=> ‘SELL’,
‘positionSide’=> ‘BOTH’,
‘type’=> ‘TAKE_PROFIT_MARKET’,
‘stopPrice’=> $take_profit_price,
‘closePosition’=> ‘TRUE’,
‘timeInForce’=> ‘GTC’,
‘workingType’=> ‘CONTRACT_PRICE’, // or MARK_PRICE
‘priceProtect’=> ‘TRUE’
], ‘POST’);
print_r($response);
$response = binance::call(’/fapi/v1/order’, [
‘symbol’=> $key_pair,
‘side’=> ‘SELL’,
‘positionSide’=> ‘BOTH’,
‘type’=> ‘STOP_MARKET’,
‘stopPrice’=> $stop_loss_price,
‘closePosition’=> ‘TRUE’,
‘timeInForce’=> ‘GTC’,
‘workingType’=> ‘CONTRACT_PRICE’, // MARK_PRICE
‘priceProtect’=> ‘TRUE’
], ‘POST’);
print_r($response);
What does the error in TSM indicate? Ty.