Orders to OKX through API keep failing

Custom indicators, trading strategies, data export and recording and more...
dmjjdkoqgoksj
Posts: 1
Joined: Sun Aug 28, 2022 1:59 pm

Orders to OKX through API keep failing

Post by dmjjdkoqgoksj » 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:

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());

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Orders to OKX through API keep failing

Post by Andry API support » Mon Aug 29, 2022 6:57 am

You are using it correctly. May I take a look at your logs (both common and trading)? Please indicate what time did you send your orders with API so I can find the events in your log.

Post Reply