I’m trying to place a limit order(Time in Force:GTC) for a spot currency but some times the api (sync version) doesn’t give me any response, the execution of the code remain blocked to wait a response.
I’m not able to understand if I wrong something, because I don’t see any error.
Someone can help me?
We haven’t received many reports about delay with order creation’s response, so it’s possible that it’s related with unstable network in the middle of data transmission. Make sure you don’t have anything that could block, like proxy/firewall .
this behaviour is random, sometimes works fine , other times not remain blocked.
is there same input parameter that can influence a limit order execution?
I don’t know for example the quantity , I’m trying to sell all the balance.
The problem was in the price/ quantity that should be always rounded according filters:
Quantity use the stepSize to avoid the LOT_SIZE exception
{
“filterType”: “LOT_SIZE”,
“minQty”: “0.01000000”,
“maxQty”: “900000.00000000”,
“stepSize”: “0.01000000”
}
use the ticksize to set the limit prices:
{
“filterType”: “PRICE_FILTER”,
“minPrice”: “0.00010000”,
“maxPrice”: “1000.00000000”,
“tickSize”: “0.00010000”
},
this is an example:
int precision = (int) Math.round(-Math.log10(stepSize));
double qt2= roundFloor(qt,precision);
public double roundFloor(double value, int places) {
if (places < 0)
throw new IllegalArgumentException();
BigDecimal bd = new BigDecimal(value);
bd = bd.setScale(places, RoundingMode.FLOOR);
return bd.doubleValue();
}