IG Streaming TRADE:{account identifier}
Trade notifications for one account in three fields: CONFIRMS for deal confirmations, OPU for open position updates and WOU for working order updates. The value of each is a JSON object.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
This is a subscription of the IG Streaming API, not an HTTP endpoint. It has no method and no path: it travels over a Lightstreamer connection that stays open, which a Lightstreamer client library manages.
IG's guide says DISTINCT mode, where every update yields a notification, is required for trade notifications. Its sample code parses the value of a field as JSON to read a confirmation.
The message
- Name
- TRADE:{account identifier}
- Direction
- Subscription, opened by the client and then fed by the server
- Subscribed to as
- TRADE:{account identifier}, in the mode DISTINCT
- Carried by
- Lightstreamer. IG's Streaming API Guide (labs.ig.com/streaming-api-guide.html), opened the same day, says the server address is the Lightstreamer address returned by the REST /session call and should not be hard coded, that the user is the active account identifier, and that the password is built from the CST and X-SECURITY-TOKEN tokens of the REST session. It gives 40 as the default number of simultaneous subscriptions on one connection.
Fields
| Name | Type | Description |
|---|---|---|
| CONFIRMS | Not stated | Deal confirmations for the account. A JSON object with the fields listed below under CONFIRMS. |
| CONFIRMS.direction | Constant | BUY or SELL. |
| CONFIRMS.limitLevel | Number | The limit level. |
| CONFIRMS.stopLevel | Number | The stop level. |
| CONFIRMS.dealId | String | The deal identifier. |
| CONFIRMS.expiry | String | The expiry of the instrument. |
| CONFIRMS.size | Number | The size of the trade. |
| CONFIRMS.epic | String | The epic of the instrument. |
| CONFIRMS.level | Number | The level of the trade. |
| CONFIRMS.guaranteedStop | Boolean | True where a guaranteed stop is in place. |
| CONFIRMS.dealReference | String | The deal reference. |
| CONFIRMS.dealStatus | Constant | ACCEPTED or REJECTED. |
| CONFIRMS.affectedDeals | Array[Object] | The deals affected. Each entry holds a dealId and a status, one of AMENDED, DELETED, FULLY_CLOSED, OPENED and PARTIALLY_CLOSED. |
| CONFIRMS.status | Constant | The status of the position or working order that results: AMENDED, CLOSED, DELETED, OPEN or PARTIALLY_CLOSED. |
| CONFIRMS.repeatDealingWindow | Object | The repeat dealing windows. Its entries each hold a size and an expiry timestamp. |
| OPU | Not stated | Open position updates for the account. A JSON object with the fields listed below under OPU. |
| OPU.direction | Constant | BUY or SELL. |
| OPU.limitLevel | Number | The limit level. |
| OPU.stopLevel | Number | The stop level. |
| OPU.dealId | String | The deal identifier. |
| OPU.expiry | String | The expiry of the instrument. |
| OPU.size | Number | The size of the trade. |
| OPU.epic | String | The epic of the instrument. |
| OPU.level | Number | The level of the trade. |
| OPU.guaranteedStop | Boolean | True where a guaranteed stop is in place. |
| OPU.dealReference | String | The deal reference. |
| OPU.dealStatus | Constant | ACCEPTED or REJECTED. |
| OPU.dealIdOrigin | String | The deal identifier of the deal this one came from. |
| OPU.timestamp | Date | The date and time of the event. |
| OPU.status | Constant | The status of the position: OPEN for opened, UPDATED for updated, DELETED for closed. |
| OPU.channel | String | The channel the user dealt through. The page says not to bind to this value, because it will become a constant. |
| OPU.currency | String | The currency. |
| OPU.trailingStopDistance | Number | The distance of the trailing stop. |
| OPU.trailingStep | Number | The increment of the trailing stop. |
| WOU | Not stated | Working order updates for the account. A JSON object with the fields listed below under WOU. |
| WOU.direction | Constant | BUY or SELL. |
| WOU.limitDistance | Number | The limit distance. |
| WOU.stopDistance | Number | The stop distance. |
| WOU.dealId | String | The deal identifier. |
| WOU.expiry | String | The expiry of the instrument. |
| WOU.size | Number | The size of the trade. |
| WOU.epic | String | The epic of the instrument. |
| WOU.level | Number | The level of the trade. |
| WOU.guaranteedStop | Boolean | True where a guaranteed stop is in place. |
| WOU.dealReference | String | The deal reference. |
| WOU.dealStatus | Constant | ACCEPTED or REJECTED. |
| WOU.timestamp | Date | The date and time of the event. |
| WOU.status | Constant | The status of the working order: OPEN for opened, UPDATED for updated, DELETED for closed. |
| WOU.currency | String | The currency. |
| WOU.orderType | Constant | LIMIT for a limit order, STOP for a stop order. |
| WOU.timeInForce | Constant | GOOD_TILL_CANCELLED or GOOD_TILL_DATE. |
| WOU.goodTillDate | Date | The date the order is good until. |
| WOU.channel | String | The channel the user dealt through. The page says not to bind to this value, because it will become a constant. |
Limits that apply at IG
| Limit | Value | Scope | Source |
|---|---|---|---|
| Historical price data points a week | 10,000 | Per account, price history endpoints only | labs.ig.comchecked |
| Non trading requests a minute | 30 | Per account, non trading calls only | labs.ig.comchecked |
| Non trading requests a minute | 60 | Per application, that is per API key, non trading calls only | labs.ig.comchecked |
| Concurrent streaming subscriptions | 40 | Per streaming connection | labs.ig.comchecked corroborated by labs.ig.com/streaming-api-guide.html |
| Trading requests a minute | 100Sources conflict ig.com states around 40, checked . IG's own pages disagree. The conflict is labelled, not resolved. Pace against 40. | Per account, trading calls only | labs.ig.comchecked |