Documentation
The Questrade API allows developers to create their own fully featured trading and analytical applications through their brokerage account.
REST operations
POST accounts/:id/orders/strategy
Allows to (re)place or estimate impact of a multi-leg strategy order against a certain account.
Sample Request
| Property | Type | Description |
|---|---|---|
| Propertyid | TypeString | DescriptionAccount number against which order is being submitted. Can occur in the 'Location' header only. |
| PropertysymbolId | TypeInteger | DescriptionInternal symbol identifier. Always an underlying symbol Id. |
| PropertylimitPrice | TypeDouble | DescriptionLimit price |
| PropertyorderType | TypeEnumeration | DescriptionOrder type (e.g., "Market"). See Order Type section for all allowed values. |
| PropertytimeInForce | TypeEnumeration | DescriptionOrder duration (e.g., "DAY"). See Order Duration section for all allowed values. |
| PropertyprimaryRoute | TypeEnumeration | DescriptionPrimary order route (e.g., "AUTO"). |
| PropertysecondaryRoute | TypeEnumeration | DescriptionSecondary order route (e.g., "NYSE"). |
| Propertylegs | TypeComplex | DescriptionLegs data |
| Propertystrategy | TypeEnumeration | DescriptionStrategy type (e.g. "CoveredCall") See Strategy Types section for all allowed values. |
InsertOrderLegData
| Name | Type | Default | Description |
|---|---|---|---|
| NamesymbolId | TypeInteger | Default | DescriptionInternal symbol identifier. |
| Nameaction | TypeEnumeration | Default | DescriptionLeg action (e.g. "Buy") See Order Action section for all allowed values. |
| NamelegQuantity | TypeInteger | Default | DescriptionLeg quantity |
Maximum of 4 legs is allowed.
If the Strategy Type is set as not Custom, then it will be verified to the mentioned strategy.
NOTE: Leg quantities will be factorized. For example, if you place quantities of 10 and 1000, then they will be sent as an order quantity of 10 and leg ratio quantities of 1 and 100. Price also uses a factorized strategy. Refer to the strategy quote call to be sure which price to use.
New Strategy
Data is the same but URLs for insertion and impact are slightly different.
POST https://api01.iq.questrade.com/v1/accounts/90000004/orders/strategy/impact
POST https://api01.iq.questrade.com/v1/accounts/90000004/orders/strategy
{
"symbolId": 27426,
"quantity": 1,
"limitPrice": -1.23,
"orderType": "Limit",
"timeInForce": "Day",
"primaryRoute": "MNGD",
"secondaryRoute": "AUTO",
"legs": [
{
"symbolId": 10550014,
"action": "Sell",
"legRatioQty": 10
},
{
"symbolId": 27426,
"action": "Buy",
"legRatioQty": 1000
}
],
"strategy": "Custom"
}Sample JSON response for impact:
{
"estimatedCommissions": 30.830048,
"buyingPowerEffect": -14161.660096,
"buyingPowerResult": 1957395.027392,
"maintExcessEffect": -7080.830048,
"maintExcessResult": 978697.513696,
"tradeValueCalculation":"10 x (-1.23) x 100 = CR 1,230.00 USD",
"legs": [
{
"legId": 0,
"symbol": "MSFT",
"symbolId": 27426,
"legRatioQuantity": 100,
"side": "Buy",
"avgExecPrice": null,
"lastExecPrice": null
},
{
"legId": 1,
"symbol": "MSFT20Jan17C70.00",
"symbolId":" 7413503,
"legRatioQuantity": 1,
"side": "STO",
"avgExecPrice": null,
"lastExecPrice": null
}
],
"side": "Buy",
"effect": "Credit",
"price": -1.23,
"strategy": "CoveredCall"
}Sample JSON response for insertion:
{
"orderId": 330711306 ,
"orders": [
{
"id": 330711306 ,
"symbol": "MSFT",
"symbolId": 27426,
"totalQuantity": 10,
"openQuantity": 10,
"filledQuantity": 0,
"canceledQuantity": 0,
"side": "Buy",
"orderType": "Limit",
"limitPrice": -1.23,
"stopPrice": null,
"isAllOrNone": false,
"isAnonymous": false,
"icebergQuantity": null,
"minQuantity": null,
"avgExecPrice": 0,
"lastExecPrice": null,
"source": "TradingAPI",
"timeInForce": "Day",
"gtdDate": null,
"state": "Pending",
"rejectionReason": "",
"chainId": 330711306,
"creationTime": "2015-08-24T15:48:58.476000-04:00",
"updateTime": "2015-08-24T15:48:58.594000-04:00",
"notes": "",
"primaryRoute": "MNGD",
"secondaryRoute": "AUTO",
"orderRoute": "MNGD",
"venueHoldingOrder": "",
"comissionCharged": 0,
"exchangeOrderId": "",
"isSignificantShareHolder": false,
"isInsider": false,
"isLimitOffsetInDollar": false,
"userId": 90040,
"placementCommission": null,
"legs": [
{
"legId": 0,
"symbol": "MSFT",
"symbolId": 27426,
"legRatioQuantity": 100,
"side": "Buy",
"avgExecPrice": 0,
"lastExecPrice": null
},
{
"legId":1,
"symbol": "MSFT20Jan17C70.00",
"symbolId": 7413503,
"legRatioQuantity": 1,
"side": "STO",
"avgExecPrice": 0,
"lastExecPrice": null
}
],
"strategyType": "CoveredCall",
"triggerStopPrice": null,
"orderGroupId": 0,
"orderClass": null,
"isCrossZero": false
}
...
]
}Already a Questrade client?
Create your first application using your Questrade account.
Integrate your application with Questrade API
Support
If you are using an api app developed by a third party, you are required to read, understand and accept the end-user license agreement for application program interface. If you are utilizing api access for an api-enabled app you built, you are required to read, understand and accept the Questrade personal application program interface ("api") license agreement ("license agreement"). This agreement can be found below. You may be bound by both agreements.


