Orders

This function will help you to fetch the working orders for a given account. It takes three parameters: the provider, account and the callback function that will be called when the result is available.

function orders(provider, account, callback)

Possible Responses:

  • Success

{
    "RQT":"orders",                 // Request Type
    "RQI":"30",                     // Request Id
    "RES":"OK",                     // Result
    "PV":"QOR",                     // Provider
    "AC":"acc2342425"               // Account
    "ORDERS":[
    {
        "OD":"435626",              // Order Id
        "ST":"N",                   // Order Status
        "SD":"B",                   // Side: B / S
        "QT":"5",                   // Quantity
        "INS":"ESZ17",              // Instrument
        "TP":"LMT",                 // Order Type
        "PR":"1300",                // Price
        "LM":"1300"                 // Limit
    }
    ...
    ]
}
  • Error

{
    "RQT":"orders",                 // Request Type
    "RQI":"30",                     // Request Id
    "RES":"ERR",                    // Result
    "MSG":"Account not found"       // Error Message
}