Hi
I am trying out with the companion app to get daily data, but seem to always find that the lastTradedVolume is zero. A typical request is:
https://api.ig.com/gateway/deal/prices/KA.D.BARC.DAILY.IP/DAY?startdate=2014%3A11%3A06-00%3A00%3A00&enddate=2014%3A11%3A07-00%3A00%3A00
i.e. get daily data for Thursday and Friday of last week for Barclays Bank (a heavily traded share usually!).
The response is as below and the volumes are all zero.
I was expecting that the daily volume would be returned in this data, but it seems to be zero for the samples I've tried.
Is this a bug, or is the volume something else instead ?
-Peter
HTTP 200
status: success
Content-Type: application/json;charset=UTF-8
{
"prices": [{
"snapshotTime": "2014:11:06-00:00:00",
"openPrice": {
"bid": 235.36,
"ask": 237.04,
"lastTraded": null
},
"closePrice": {
"bid": 235.96,
"ask": 236.54,
"lastTraded": null
},
"highPrice": {
"bid": 240.46,
"ask": 240.94,
"lastTraded": null
},
"lowPrice": {
"bid": 233.47,
"ask": 233.98,
"lastTraded": null
},
"lastTradedVolume": 0
}, {
"snapshotTime": "2014:11:07-00:00:00",
"openPrice": {
"bid": 236.91,
"ask": 237.49,
"lastTraded": null
},
"closePrice": {
"bid": 233.67,
"ask": 234.23,
"lastTraded": null
},
"highPrice": {
"bid": 237.41,
"ask": 237.94,
"lastTraded": null
},
"lowPrice": {
"bid": 233.17,
"ask": 233.78,
"lastTraded": null
},
"lastTradedVolume": 0
}],
"instrumentType": "SHARES",
"allowance": {
"remainingAllowance": 9946,
"totalAllowance": 10000,
"allowanceExpiry": 257005
}
}
So to answer my own question: It looks like this is because my account is not registered for CFD trading. I found this when looking at the graphs on the main web app and couldn't get them there either - but did get a helpful message telling me why.
Hi Peter
The reason for the error is that we don't provide any pricing data for equities via the API. This will include live, historical, and volume data.
There's a bit more info in this thread here: https://labs.ig.com/node/86
Chris