You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function marketSell(string $symbol, $quantity, array $flags = [])
{
// Get exchange information and filters for a specific symbol
$exchangeInfo = $this->exchangeInfo();
$symbolFilters = $exchangeInfo['symbols'][$symbol]['filters'];
$minQty = null;
// Look for the LOT_SIZE filter and get the minQty from there
foreach ($symbolFilters as $filter) {
if ($filter['filterType'] === 'LOT_SIZE' && isset($filter['minQty'])) {
$minQty = $filter['minQty'];
break;
}
}
// If minQty is not found, record an error and return false
if ($minQty === null) {
error_log("Not found minQty for LOT_SIZE filter for $symbol pair");
return false;
}
// Determine the number of decimal places for minQty and round the number of decimal places
$c = $this->numberOfDecimals($minQty);
$quantity = $this->floorDecimal($quantity, $c);
// Create Order
return $this->order("SELL", $symbol, $quantity, 0, "MARKET", $flags);
}
The text was updated successfully, but these errors were encountered:
Example for function marketSell
Before:
After:
public function marketSell(string $symbol, $quantity, array $flags = [])
{
// Get exchange information and filters for a specific symbol
$exchangeInfo = $this->exchangeInfo();
$symbolFilters = $exchangeInfo['symbols'][$symbol]['filters'];
The text was updated successfully, but these errors were encountered: