Update to API - June 2016

14 posts / 0 new
Last post
Chris
Update to API - June 2016

Hi All,

We are pleased to announce we’ve just updated the REST API with a couple new features:

- New activity history v3 endpoint
- Create & edit Working order request now accept stop/limit levels
- Faster multi-market details endpoint has new parameter to only fetch price data
- All responses now return header X-REQUEST-ID identifying the request

Also you can find some of our samples now in Github where you can now contact us to get your samples contributed to this table. If there is something you would like to add then please let us know!

You can add a link to your repository too!

https://github.com/ig-python/ig-markets-api-python-library

We hope you enjoy!

f2calv
good progress but a couple of bugs :)

Chris thanks for the update, it all looks to be progress in the right direction.
All the updates seem to be working fine, however there appear to be a few anomalies in the new activity history v3 endpoint.

I have copied in 3 activity records from yesterdays session (Friday 17th June), and working from bottom to top;
1) initially a working order created via the API
2) the System opened the trade
3) finally position manually closed via the web interface.

The 6 bugs/anomalies as I can see;

"level": 0, - this is zero in all 3 records, it needs populating.
"currency": "QGB", - this should be GBP as far as I can tell?
"stopLevel": 0, - this should either be null or a value, never zero as "stopDistance": 16,
"limitLevel": 0, - this should either be null or a value, never zero as "limitDistance": 8
enum "POSITION_OPENDED" incorrectly spelt here and in documentation.
There are occurrences of "actionType": "UNKNOWN" in each of the three messages - what exactly are these UNKNOWNs?

Thank you for your efforts :)

{
"activities": [{
"date": "2016-06-17T09:25:34",
"epic": "IX.D.DAX.IFS.IP",
"period": "-",
"dealId": "DIAAAABHB82HNAW",
"channel": "WEB",
"type": "POSITION",
"status": "ACCEPTED",
"description": "Position/s closed: HB89UXAM",
"details": {
"dealReference": "434QQ8S7H9T2K",
"actions": [{
"actionType": "POSITION_CLOSED",
"affectedDealId": "DIAAAAAHB89UXAM"
}, {
"actionType": "UNKNOWN",
"affectedDealId": "DIAAAABHB89UXAM"
}],
"marketName": "Germany 30 Cash (£1 Contract)",
"goodTillDate": null,
"currency": "QGB",
"size": 2,
"direction": "SELL",
"level": 0,
"stopLevel": 0,
"stopDistance": 16,
"guaranteedStop": false,
"trailingStopDistance": 0,
"trailingStep": 0,
"limitLevel": 0,
"limitDistance": 8
}
}, {
"date": "2016-06-17T09:19:31",
"epic": "IX.D.DAX.IFS.IP",
"period": "-",
"dealId": "DIAAAABHB89UXAM",
"channel": "SYSTEM",
"type": "POSITION",
"status": "ACCEPTED",
"description": "Position opened: HB89UXAM; Stop order filled: DIAAAABHB89UXAM",
"details": {
"dealReference": "4FZCWDLATYCAP9V",
"actions": [{
"actionType": "POSITION_OPENDED",
"affectedDealId": "DIAAAAAHB89UXAM"
}, {
"actionType": "UNKNOWN",
"affectedDealId": "DIAAAABHB89UXAM"
}, {
"actionType": "STOP_ORDER_FILLED",
"affectedDealId": "DIAAAAADIAAAABHB89UXAM"
}, {
"actionType": "UNKNOWN",
"affectedDealId": "DIAAAABHB89UXAM"
}],
"marketName": "Germany 30 Cash (£1 Contract)",
"goodTillDate": null,
"currency": "QGB",
"size": 2,
"direction": "BUY",
"level": 0,
"stopLevel": 0,
"stopDistance": 16,
"guaranteedStop": false,
"trailingStopDistance": 0,
"trailingStep": 0,
"limitLevel": 0,
"limitDistance": 8
}
}, {
"date": "2016-06-17T09:19:08",
"epic": "IX.D.DAX.IFS.IP",
"period": "-",
"dealId": "DIAAAABHB89UXAM",
"channel": "PUBLIC_WEB_API",
"type": "WORKING_ORDER",
"status": "ACCEPTED",
"description": "Stop order opened: HB89UXAM; Good till cancelled",
"details": {
"dealReference": "4FZCWDLATYCAP9V",
"actions": [{
"actionType": "STOP_ORDER_OPENED",
"affectedDealId": "DIAAAAAHB89UXAM"
}],
"marketName": "Germany 30 Cash (£1 Contract)",
"goodTillDate": "GTC",
"currency": "QGB",
"size": 2,
"direction": "BUY",
"level": 0,
"stopLevel": 0,
"stopDistance": 16,
"guaranteedStop": false,
"trailingStopDistance": 0,
"trailingStep": 0,
"limitLevel": 0,
"limitDistance": 8
}
}],
"metadata": {
"paging": {
"size": 50,
"next": "/history/activity?version=3&from=2016-06-17T00:00:00&to=2016-06-17T05:59:38&detailed=true&pageSize=50"
}
}
}

f2calv
also...

Whilst looking at the other activity requests namely transactions, I have a few small/quick suggestions to create an improved transaction history endpoint;

Essential new fields;
Add "epic" - currently it only has "instrumentName" meaning we have to match the transaction to the activity using the dealId causing more endpoint calls.
Add "positionOpenDate" - UTC datetime when the position was opened, including granularity in seconds.

Property amendments;
"dateUtc" - add seconds granularity and possibly rename field to "positionCloseDate"
"currency" - change this to a 3-letter ISO, instead of "$", "£", etc...

Thanks in advance!

Chris
Re: Update to API - June 2016

Hey f2calv,

Thanks for the feedback and highlighting these bugs. We're currently working to resolve these now.

Many thanks,
Chris

APItrader
I second the changes

I second the changes/additions to the transactions endpoint suggested by f2calv. In addition I think it would be nice if the "profitAndLoss" field were purely numeric, i.e., not containing the currency code/symbol (which is anyway found in a separate field) and not containing "thousand separators."

APItrader
Great additions. Thanks!

Great additions. Thanks!

Fabian
Hello,

Hello,

in Germany IG add a new feature to the 4th of July. We can update positions with guarented stops! (Maybe its for all IG countrys!?)
When is this possible with the Java SDK? I have downloaded the newest version 2.1.34, but the class UpdateOTCPositionV2Request doesn't have any method to set the guarented stop.

I hope you understand me.

thanks!

Chris
Hello,

Hi Fabian,

This new feature refers to the limited risk trading changes but the front-end will not allow you to switch between limit and non-limit risk once a position has been opened.

With that in mind the UpdateOTCPositionV2Request won't have a new field to set/remove a guaranteed stop.

Our API developers are looking at the new change to see what can be done in the future. I hope that helps!

Thanks,

Chris

Fabian
Hi Chris,

Hi Chris,

on my android device (Ig Android App Version 2.56) i have the possibility to edit my Stop of an open position. I can change from No-Stop to normal Stop, from normal-Stop to guaranteed-Stop, from guaranteed-stop to no stop and so on.
I think its not possible on the api now? Do you know when? Have to edit the backend of the api or can i build my own solution?

Thanks!

Fabian
Hi Chris,

Hi Chris,
i get an answer of the IG Support. (Germany)
The API will update in January. Can you confirm this?
Its important for me! If the update dont come in January i have to change my own code to trade!

Chris
Update to API - June 2016

Hi All,

Just to let you know that value “POSITION_OPENDED” will be amended to “POSITION_OPENED” which is NOT a backwards compatible change. We usually don’t break backwards-compatibility of existing endpoints but we treat this as a special case as it is a new endpoint still being adopted.

If you have any questions please let me know

Thanks,

Tim

joehcole
Russell 2000

Just noticed that price info for the RUSSELL 200 DFB (TM.D.RUS2000.DAILY.IP) does not seem to be have been retrievable since the 17 June update.

I'm getting this error:

"errorCode": "unauthorised.access.to.equity.exception"

APItrader
https://labs.ig.com/node/478
Fabian
Hi Chris,

Hi Chris,

i get an answer of the IG Support. (Germany)
The API will update in January. Can you confirm this?
Its important for me! If the update dont come in January i have to change my own code to trade!

Log in or register to post comments