Jump to content
  • 0

Does the API support individual equity price history?


icarus33

Question

Hi everyone who reads,

I'm trying (so far unsuccessfully) to develop some code that will scan a whole market (i.e. all stocks within ASX200 or S&P500) and alert me when any of the stocks touch some specific moving averages I'm looking for. But first I'm trying to back test this for the past 6 years.

Using the API companion and I know I'm authenticating correctly.

It works with the Russell Index:
https://api.ig.com/gateway/deal/prices/IX.D.RUSSELL.IFM.IP?resolution=DAY&from=2015-07-21T00%3A00%3A00&to=2024-03-21T23%3A59%3A59

And with FTSE:
https://api.ig.com/gateway/deal/prices/IX.D.FTSE.CFD.IP?resolution=DAY&from=2015-07-21T00%3A00%3A00&to=2024-03-21T23%3A59%3A59

The problem comes when I try a single equity, in this case Fortescue Metals, or AA.D.FMG.DAILY.IP. Can search market details successfully:
https://api.ig.com/gateway/deal/markets/AA.D.FMG.DAILY.IP

But if I try searching historical prices during a time period I get a:

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

(https://api.ig.com/gateway/deal/prices/AA.D.FMG.DAILY.IP?resolution=DAY&from=2015-07-21T00%3A00%3A00&to=2024-03-24T23%3A59%3A59)

I'm reading in a couple of older posts that IG does not support equity price history over APIs... is this true?

Link to comment

2 answers to this question

Recommended Posts

  • 0

The IG API does not support equity dealing or price history at all. The IG API can be used to trade spread bets (or CFDs) on equities, indices, FX, commodities, bonds, rates VIX etc. Its important to understand the difference.

The error you are seeing is misleading. It seems that in certain cases you can use the API to trade a market, but historic price data is not available for that same market. I came across the same error message when trying to get historic prices for a dated spread bet on the VIX. When queried with support, the response was not very clear. Reading between the lines, my interpretation was that IG's licence for the historic price data does not allow IG to pass it on to us via the API.

Regarding your project to "scan a whole market" - can I offer a suggestion? A would find another way to get historic prices. The IG API is not a good resource for this sort of thing. You are limited to 10,000 data points of historic prices per week. I would imagine you would need at least hourly data for your price scanner. So, 8 hours a day, 5 days a week, 200 shares in the ASX, 500 in the S&P, 100 in the FTSE, and 2000 in the Russell. You're going to be about 100,000 datapoints short, every week. Even daily prices is too many

 

  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
us