Invalid order type

Added by Arthur about 3 years ago

Hi,
I get the following error from test system

{"message":"Invalid order type.","order_id":0,"result_code":"INVALID_ORDER_TYPE","order_state":"DELETED","action_state":"INS_FAIL"}

when placing the order

String obj = "{\"identifier\":\"930911\", \"market_id\":18,  \"volume\":1,  \"side\":\"BUY\" ,\"order_type\": \"STOP_TRAILING\",\"activation_condition\": \"STOP_ACTPRICE_PERC\",\"trigger_value\": 5,\"trigger_condition\": \"<=\" ,\"target_value\": 0}";

however, when placing the following order it works, with different order_type or with different market.

String obj = "{\"identifier\":\"101\", \"market_id\":11,  \"volume\":1,  \"side\":\"BUY\" ,\"order_type\": \"STOP_TRAILING\",\"activation_condition\": \"STOP_ACTPRICE_PERC\",\"trigger_value\": 5,\"trigger_condition\": \"<=\" ,\"target_value\": 0}";

or

String obj = "{\"identifier\":\"930911\", \"market_id\":18,  \"volume\":1, \"price\": 1.00, \"currency\": \"USD\", \"side\":\"BUY\"}";

could you clarify what is wrong with the first order json.

regards
bruce
----------


Replies (2)

RE: Invalid order type - Added by Björn about 3 years ago

Is the order type supported for your specific tradable?
The information is available in the response from "GET /next/2/tradables/info/{tradables}".

RE: Invalid order type - Added by Arthur about 3 years ago

Thanks for the clarification,
I found this tradable supports only LIMIT orders, {
"type": "LIMIT",
"name": "Normal order"
}

When I post a limit order it asks for price parameter, could you suggest how to sell/buy LIMIT orders at market price using nordnet APIs?
We would like to place order(sure to be executed) that matches the best market price at the moment.

regards
bruce
----------

(1-2/2)