2.10.2 Variable values in the API documentation

Author: The Little Dream, Created: 2017-02-13 15:45:36, Updated: 2017-10-11 10:21:57

2.10.2 Variable values in the API documentation

The description in the API documentation:

img

  • The status value in the order structure

ORDER_STATE_PENDING: not completed # value is 0 ORDER_STATE_CLOSED: is closed # value 1 ORDER_STATE_CANCELED: # value 2 has been canceled

  • Type value in the order structure

ORDER_TYPE_BUY: Payment # value is 0 ORDER_TYPE_SELL: The sale order has a value of #1.

  • Type attribute of the position structure

PD_LONG: # value is 0 PD_SHORT: Currently empty storage # value 1 PD_LONG_YD: Yesterday's overstock # value is 2 PD_SHORT_YD: Yesterday's empty shed # value is 3

  • The test code is:
function main(){
    Log("Order结构里的Status值 ↑");
    Log("ORDER_STATE_PENDING", ORDER_STATE_PENDING);
    Log("ORDER_STATE_CLOSED", ORDER_STATE_CLOSED);
    Log("ORDER_STATE_CANCELED", ORDER_STATE_CANCELED);
    
    Log("Order结构里的Type值↑");
    Log("ORDER_TYPE_BUY", ORDER_TYPE_BUY);
    Log("ORDER_TYPE_SELL", ORDER_TYPE_SELL);
    
    Log("Position 结构的 Type 属性↑");
    Log("PD_LONG", PD_LONG);
    Log("PD_SHORT", PD_SHORT);
    Log("PD_LONG_YD", PD_LONG_YD);
    Log("PD_SHORT_YD", PD_SHORT_YD);
}

img

  • Other:

In the order information obtained by OKEX's GetOrder for the specified order ID, the status value is 3, i.e. the unknown state, possibly the state of the order cancellation process.


More