Positions

This function will help you, to fetch all the positions for a given account. It takes three parameters the provider, account and the callback function.

function positions(provider, account, callback)

Possible Responses:

  • Success

{
    "RQT":"positions",                  // Request Type
    "RQI":"35",                         // Request Id
    "RES":"OK",                         // Result
    "PV":"QOR",                         // Provider
    "AC":"acc2342425"                   // Account
    "POSITIONS":[
    {
        "PD":"435626",                  // Position Id
        "SD":"L",                       // Side: L (long) / S (short)
        "QT":"5",                       // Quantity
        "INS":"ESZ17",                  // Instrument
        "PR":"1300"                     // Price
    }
    {
        "FD":"43",                      // Fill Id
        "OD":"423",                     // Order Id
        "SD":"S",                       // Side: L (long) / S (short)
        "QT":"1",                       // Quantity
        "INS":"ESZ17",                  // Instrument
        "PR":"1307"                     // Price
    }
    ...
    ]
}
  • Error

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