Jump to content
  • 0

Cannot get DAY_OPEN_MID from REST API


SCROTCH

Question

Hi

Using the streaming API, it's possible to get DAY_OPEN_MID for the current trading session using a CHART:TICK subscription. The same value can also be obtained from MID_OPEN using a MARKET subscription. Lastly, it can also be calculated for the current trading session using the /markets endpoint of the REST API using the "bid", "offer" and "netChange" attributes.

Note that all of these options apply to the current trading session only, and there doesn't seem to be any way to fetch or calculate the same value for previous sessions. I would like this info as part of my backtesting strategy. Is there any way to fetch or calculate it using the REST API?

Link to comment

2 answers to this question

Recommended Posts

  • 0
7 hours ago, Bopperz said:

Hi,

Get the price history. This will give you the candle opening bid/ask, then find the mid point.

'https://api.ig.com/gateway/deal/prices/'+epic+'?resolution='+freq+'&from='+d1+'&to='+d2+'&pageSize='+str(5000)

 

You need to add epic, freq, d1, d2

Hi

Thanks for responding but I should have made clear that it's impossible to determine the Monday morning gap up/down from the candle data.

eg DAY_OPEN_MID on Monday for IX.D.DOW.IFA.IP was 30195.4 whereas the candle from the open returns 

"openPrice": {
    "bid": 30401.5,
    "ask": 30406.3,
    "lastTraded": null
}

 

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...