Sprint Markets

23 posts / 0 new
Last post
Chris
Sprint Markets

Hi all

We’re glad to announce that Sprint Markets are now available via the API.

We’ve updated the REST and Streaming API reference pages, along with the companion apps. We’ll be updating the Java and .NET SDKs in the coming weeks as well.

For those interested in learning more about Sprint Markets, you can find more info here: http://www.ig.com/uk/sprint-markets-binaries

Chris

OscarYop
Hi Chris,

Hi Chris,

I am trying the new Sprints API and I see some problems. I open a position via POST to /positions/sprintmarkets and get the dealReference from the response. Ok. Then I call /confirms, passing dealReference to see the result of the trade. Great.

The problem is that sometimes the deal is "REJECTED" with reason "UNKNOWN". If I go to the web platform I can read the error on the activities tab, wich is "You have selected an invalid expiry time, please try again". I know that the expiration is not the problem because if I send the same trade via the web platform, it works.

For example, right now, a trade on USDJPY with expiry 20 minutes fails via API and works via web. The same trade on EURUSD works via API and via web.

Also, could you add the status to the response of /positions/sprintmarkets? Do we have to always call /confirms right after to know if the trade was accepted?

Could you add a specific error on the response of /confirms, other than "UNKNOWN"?

Many thanks,

Konsti
Hi OscarYop, assuming that

Hi OscarYop, assuming that you are using Excel VBA, could you please share how your code looks like for placing the Sprint Market orders. I am trying to use the code below but I always get "invalid.input" error message.

Private Sub SprintTrade()

If Not m_loggedIn Then
MsgBox "Please login first"
Exit Sub
End If
Dim epic As String
Dim expiry As String
Dim direction As String
Dim size As String
Dim crncy As String
Dim limit As String
Dim dealReference As String
Dim dealId As String
Dim count As Integer
epic = "FM.D.DAX.DAX.IP"
expiry = "FIVE_MINUTES"
direction = "SELL"
size = "35"
dealReference = restClient.createSprintPosition(epic, expiry, direction, size)

End Sub

Public Function createSprintPosition(epic As String, expiry As String, direction As String, size As String) As
String

Call oXMLHTTP.Open("POST", IG_API_HOST + "/positions/sprintmarkets", False)
Dim requestBodyDictionary As Dictionary
Set requestBodyDictionary = New Dictionary
Call requestBodyDictionary.Add("direction", direction)
Call requestBodyDictionary.Add("epic", epic)
Call requestBodyDictionary.Add("expiry", expiry)
Call requestBodyDictionary.Add("size", size)
Dim requestBodyString As Variant
requestBodyString = JSON.toString(requestBodyDictionary)
Call oXMLHTTP.SetRequestHeader("X-SECURITY-TOKEN", m_accountToken)
Call oXMLHTTP.SetRequestHeader("CST", m_clientToken)
Call oXMLHTTP.SetRequestHeader("X-IG-API-KEY", m_apiKey)
Call oXMLHTTP.SetRequestHeader("Content-Type", "application/json; charset=utf-8")
Call oXMLHTTP.SetRequestHeader("Accept", "application/json; charset=utf-8")
Call oXMLHTTP.send(requestBodyString)
Dim responseData As Dictionary
Set responseData = JSON.parse(oXMLHTTP.responseText)
If oXMLHTTP.Status = 200 Then
createSprintPosition = responseData.item("dealReference")
Else
MsgBox oXMLHTTP.responseText
createSprintPosition = ""
End If

End Function

OscarYop
Rejected deals

Hi again Chris,

I made a bit of research with all the open epics and expiry periods on my demo account, and this is the result (all deals with direction=BUY and size=25)

All the rejected deals can be made succesfully via the web platform.

The result is the same if I change size or direction.

FM.D.AUDUSD24.AUDUSD24.IP TWENTY_MINUTES REJECTED
FM.D.BITCOIN.BITCOIN.IP FIVE_MINUTES REJECTED
FM.D.BITCOIN.BITCOIN.IP TWENTY_MINUTES ACCEPTED
FM.D.EURUSD24.EURUSD24.IP ONE_MINUTE REJECTED
FM.D.EURUSD24.EURUSD24.IP TWO_MINUTES ACCEPTED
FM.D.EURUSD24.EURUSD24.IP FIVE_MINUTES ACCEPTED
FM.D.EURUSD24.EURUSD24.IP TWENTY_MINUTES ACCEPTED
FM.D.EURJPY24.EURJPY24.IP TWO_MINUTES REJECTED
FM.D.EURJPY24.EURJPY24.IP FIVE_MINUTES ACCEPTED
FM.D.EURJPY24.EURJPY24.IP TWENTY_MINUTES ACCEPTED
FM.D.GBPJPY24.GBPJPY24.IP TWENTY_MINUTES REJECTED
FM.D.GBPUSD24.GBPUSD24.IP TWENTY_MINUTES REJECTED
FM.D.USDCHF24.USDCHF24.IP TWENTY_MINUTES REJECTED
FM.D.OIL.OIL.IP FIVE_MINUTES REJECTED
FM.D.OIL.OIL.IP TWENTY_MINUTES ACCEPTED
FM.D.USDJPY24.USDJPY24.IP TWENTY_MINUTES REJECTED
FM.D.DOW.DOW.IP FIVE_MINUTES REJECTED
FM.D.DOW.DOW.IP TWENTY_MINUTES ACCEPTED
FM.D.USDCAD24.USDCAD24.IP TWENTY_MINUTES REJECTED

Konsti
High Chris,

High Chris,

In addition to the aferomentioned message by OscarYop I would like to note that the the five minute deals for the following indices always get rejected and the twenty minute deals get accepted.

"FM.D.OMX.OMX.IP" , "FM.D.DAX.DAX.IP"

Is there a specific reason for that?

Chris
Rejected deals

Hi all,

We're aware of an issue and are investigating this now. I'll keep you posted on any progress.

Thanks,
Chris

Konsti
Hi Chris,

Hi Chris,

Is there already some news w.r.t. to the possibility of trading contracts shorter than 20 minutes?

Chris
Rejected deals

Hey Konsti,

Unfortunately no fix yet, however we are just looking into the possibility of a short term workaround. Hopefully I'll have some news soon.

Apologies,
Chris

Konsti
Thank you Chris, looking

Thank you Chris, looking forward to it.

neilcaithness
Hi Chris

Hi Chris

Can you tel us anything new about the shorter term contracts for the Sprint Markets?

Thanks
Neil

Chris
Rejected deals

Hi Neil & Konsti,

We're aiming to have a fix for the issue with the Sprint Markets in Live by the end of the week. I'll keep you both posted.

Thanks,
Chris

Konsti
Hi Chris,

Hi Chris,

What is the progress on the short term contracts for the Sprint Markets?

Best regards,

Konstantin

Chris
Rejected deals

Hi Konsti,

Sorry for the delayed reply. We decided to test the fix in our demo environment for a little longer before rolling it out fully. We're just awaiting some feedback on this now.

Have you tried any trades on Sprint Markets in the demo environment recently?

Thanks,
Chris

Chris
Rejected deals

Hi Konsti,

The fix has now been fully rolled out to the Live environment. Can you let me know if you encounter any further issues.

Cheers,
Chris

Konsti
Hi Chris,

Hi Chris,

I just made some trades on the sprint market on wall street with my demo account through an application with the 2 and 5 minutes to expiration. They were all accepted. Tomorrow I will try this for the European markets. Let me know if you require more user feedback.

Chris
Rejected deals

Hey Konsti,

Great to hear this. Yeah, please let us know how you get on tomorrow!

Chris

belfort
Hi Chris,

Hi Chris,

I just noticed that on a UK demo account, the minimum size for a Sprints deal is 1 GBP, while in my Euro account the minimum is 25 EUR. Is this the same in a real UK account?

belfort
oh I noticed that this

oh I noticed that this happened on a Spread betting demo account, while my account is CFD. Why is there no minimum on Spread betting?

Konsti
Hi Chris,

Hi Chris,

So I have been running my code today with the 2 minute Sprint Market positions with the German DAX and the Swedish OMX. So far I haven't seen any problems.
Is it already possible to trade the 2 and the 5 minute positions on the live account as well?

Best regards,

Konstantin

belfort
Hi Chris,

Hi Chris,

For Sprint markets epics there is the value "sprintMarketsMinimumExpiryTime", which supposedly tells the minimum expiry time allowed in seconds. But this is what happens: (I tested on all the tradeable sprint markets)

When sprintMarketsMinimumExpiryTime = 57, expiry ONE_MINUTE is accepted on Web and API
When sprintMarketsMinimumExpiryTime = 60, expiry ONE_MINUTE is accepted on Web and REJECTED on API
When sprintMarketsMinimumExpiryTime = 117, expiry TWO_MINUTES is accepted on Web and API
When sprintMarketsMinimumExpiryTime = 120, expiry TWO_MINUTES is accepted on Web and REJECTED on API

hope this helps

Chris
Rejected deals

Hi Konsti & Belfort,

Thanks for the updates.

Belfort, can you let me know which environment you are using and on which markets you have noticed the rejections.

Cheers,
Chris

belfort
Environment is demo.

Environment is demo.

I cannot run my tests at this moment because the platform is locked (login redirects to https://www.ig.com/uk/re_dealer_unavailable.html)

It depends on the allowed expiration periods, so it varies throughout the day. For example, it has happened today with FM.D.USDCHF24.USDCHF24.IP with expiration 2 minutes, while sprintMarketsMinimumExpiryTime for this market was 120

belfort
Ok,

Ok,
Markets that have sprintMarketsMinimumExpiryTime = 120 but are rejected on API demo with expiration 2 minutes, while accepted on web platform demo:
FM.D.AUDUSD24.AUDUSD24.IP
FM.D.USDCHF24.USDCHF24.IP
FM.D.GBPUSD24.GBPUSD24.IP
FM.D.USDCAD24.USDCAD24.IP

Also this one with sprintMarketsMinimumExpiryTime = 60 and expiration 1 minute:
FM.D.USDJPY24.USDJPY24.IP

Log in or register to post comments