Orders to OKX through API keep failing
Posted: Sun Aug 28, 2022 2:19 pm
I'm trying to send simple market and limit orders to OKX exchange through the API. I am using the SimpleOrderSendParametersBuilder. An order request is being sent and received by OKX, but the BM API keeps trying to send complicated orders like trailing limit which I don't want and which cause the request to fail.
Am I not using the API correctly or is this intended? I also can't find documentation for the SimpleOrderSendParametersBuilder type.
Example usage:
Am I not using the API correctly or is this intended? I also can't find documentation for the SimpleOrderSendParametersBuilder type.
Example usage:
Code: Select all
SimpleOrderSendParametersBuilder params = new SimpleOrderSendParametersBuilder(alias, isbuy, size);
params.setLimitPrice(ask + ask * 0.001); // attempting to set order limit above ask price to simulate market order
params.setDuration(OrderDuration.IOC);
api.sendOrder(params.build());