Jump to content
  • 0

API and Spread Betting


david_blumkey

Question

Hello,

I have two questions about interacting with the API in conjunction with a spread betting account. There are two things that I don't understand:

- After POSTing to `/session`, I have two accounts that are returned in the response (CFD and Spread Bet), however I don't understand how I can select that account to be used when (for example) creating and viewing trades. In the response object I can see my preferred account is selected as the CFD account, but I'm not sure how I can update this "preferred account" or even programmatically select the Spread Bet account for further use. How can I ensure the spread bet account is used for subsequent API interactions?

- When querying for market epics via `/markets`. How can I tell if a market is a spread betting market or a CFD (or other) market? There doesn't appear to be a clear way of knowing.

Thanks in advance for you time! Please let me know if I can provide any further information.

Link to comment

5 answers to this question

Recommended Posts

  • 0
21 hours ago, david_blumkey said:

Hello,

I have two questions about interacting with the API in conjunction with a spread betting account. There are two things that I don't understand:

- After POSTing to `/session`, I have two accounts that are returned in the response (CFD and Spread Bet), however I don't understand how I can select that account to be used when (for example) creating and viewing trades. In the response object I can see my preferred account is selected as the CFD account, but I'm not sure how I can update this "preferred account" or even programmatically select the Spread Bet account for further use. How can I ensure the spread bet account is used for subsequent API interactions?

- When querying for market epics via `/markets`. How can I tell if a market is a spread betting market or a CFD (or other) market? There doesn't appear to be a clear way of knowing.

Thanks in advance for you time! Please let me know if I can provide any further information.

Hi @david_blumkey,

Welcome to the IG community and thank you for your post. Please see the below answers to your questions:

1. The API will always use the account that has been set as the 'default' account as the preferred account, once logged in to the API there is a 'Switch account' function that can be used to switch between Spread Bet and CFD accounts but preferred account will always be the default account on login.

2. Most Spread Bet market EPICs will have 'Daily' or 'Cash' and CFD market EPICs will normally have 'Today' in the EPIC. The best option is to get the EPIC from the market for the specific account (Spread Bet/CFD) to ensure the right EPIC is used for the correct account and for the correct market EPIC.

All the best,

KoketsoIG
 

- KoketsoIG

Link to comment
  • 0
On 13/11/2023 at 09:17, KoketsoIG said:

Hi @david_blumkey,

Welcome to the IG community and thank you for your post. Please see the below answers to your questions:

1. The API will always use the account that has been set as the 'default' account as the preferred account, once logged in to the API there is a 'Switch account' function that can be used to switch between Spread Bet and CFD accounts but preferred account will always be the default account on login.

2. Most Spread Bet market EPICs will have 'Daily' or 'Cash' and CFD market EPICs will normally have 'Today' in the EPIC. The best option is to get the EPIC from the market for the specific account (Spread Bet/CFD) to ensure the right EPIC is used for the correct account and for the correct market EPIC.

All the best,

KoketsoIG
 

Thank you for getting back to me, and thank you for the information. Would you have a link to the endpoint that you were referring to in regards to the switching accounts function?

I thought it might the PUT /accounts/preferences endpoint, but accoring to the documentation that only allows you to enable / disable trailing stop losses:
https://labs.ig.com/rest-trading-api-reference/service-detail?id=654

Would it be possible to set in the UI? I can't seem to find the setting if so. I tried changing the "Default View", but that doesn't appear to set affect the API account

Screenshot2023-11-25at11_36_05.thumb.png.96160e6261191e73c083a34750e36ef7.png

Link to comment
  • 0
On 25/11/2023 at 13:37, david_blumkey said:

Thank you for getting back to me, and thank you for the information. Would you have a link to the endpoint that you were referring to in regards to the switching accounts function?

I thought it might the PUT /accounts/preferences endpoint, but accoring to the documentation that only allows you to enable / disable trailing stop losses:
https://labs.ig.com/rest-trading-api-reference/service-detail?id=654

Would it be possible to set in the UI? I can't seem to find the setting if so. I tried changing the "Default View", but that doesn't appear to set affect the API account

Screenshot2023-11-25at11_36_05.thumb.png.96160e6261191e73c083a34750e36ef7.png

Hi @david_blumkey,

Thank you for your post.

Please note that you can find the details in the following: /session | IG Labs it's under Login and Session

This can be done in the UI, changing 'Default view' in the web platform only changes the default account for Live accounts. You might have changed the default account for live and logged in with your demo API which is why you might have not noticed a change.

Changing the default account for the demo can only be done on the IG mobile app (Account > Manage accounts).

image.png

- KoketsoIG

Link to comment
  • 0

Understanding how to select the desired account for your API requests is crucial for seamless integration. If the response object indicates your preferred account as the CFD account, you might need to explore the API documentation further to find methods for updating this preference or programmatically selecting the Spread Bet account.

Link to comment
  • 0
On 21/03/2024 at 17:11, capitulinagarage said:

Understanding how to select the desired account for your API requests is crucial for seamless integration. If the response object indicates your preferred account as the CFD account, you might need to explore the API documentation further to find methods for updating this preference or programmatically selecting the Spread Bet account.

Remember, troubleshooting API integrations can be complex, but with patience and persistence, you'll likely find a solution that works for you. And if you're interested in expanding your knowledge of spread betting or exploring related topics, you might discover valuable insights and resources at https://www.nettcasino.com/omtaler/. Keep up the great work, and don't hesitate to reach out if you have further questions or need assistance along the way!

Edited by capitulinagarage
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
  • image.png

  • Posts

    • Following strong earnings and rising commodities, the FTSE and DAX consolidated near record highs. Dovish ECB and BoE signals, along with upcoming UK inflation data, could influence future rate cuts.   Source: Getty Images   Indices Commodities Inflation Core inflation DAX Technical analysis Written by: Tony Sycamore | Market Analyst, Australia   Publication date: Tuesday 21 May 2024 05:02 After a record-breaking rally, fuelled by strong corporate earnings, rising commodities and expectations of rate cuts, the FTSE and the DAX spent last week consolidating near record highs. While sticky inflation is expected to see the Federal Reserve keep rates higher for longer, underlying inflation in the UK and in Europe has made good progress towards target. In response, the ECB and the BoE have sounded more dovish. The expectation is that they will cut rates once or perhaps twice before the Federal Reserve starts its rate-cutting cycle in September. Whether the BoE is able to cut rates at its next meeting on 20 June, will depend to a large degree on this week's inflation report for April, which is previewed below. UK inflation data preview Date: Wednesday, 22 May at 4.00pm AEST In March, the headline annual inflation rate in the UK fell to 3.2% YoY from 3.4% prior, its lowest rate since September 2021. The annual core inflation rate, which excludes volatile items such as energy and food, dropped to 4.2%, the lowest since December 2021. Inflation's steady progress toward the BoE's target has significantly contributed to the bank's dovish tilt. The rates market is now 50% priced for a 25 basis points (bp) BoE rate cut in June, with a full 25bp rate cut expected by August. The market's preliminary expectation for this month (April) is for headline inflation to ease to 2.3% YoY and for core inflation to fall to 3.6%. If correct, this should increase the chances of a 25bp BoE rate cut in June. UK CPI data   Source: TradingEconomics DAX technical analysis The rally from the mid-April 17,626 low is viewed as the final leg (Wave V) of an impulsive rally from the October 2023, 14,630 low. (Within Elliott Wave theory, a Wave V is usually the final leg of an impulse move before a correction unfolds.) This wave count is supported by bearish divergence in the RSI indicator, showing that new price highs are not confirmed by new RSI highs. A break below short-term support at 18,567, stemming from the April high, would indicate that the rally has run its course and a pullback has commenced. However, before the pullback begins, the DAX may yet extend its gains into the 19,000/19,200 area. DAX daily chart   Source: TradingView FTSE technical analysis Since mid-March, we maintained a bullish stance on the FTSE, capturing its blistering run higher. However, we shifted to a more neutral bias ahead of the BoE meeting on May 9th, anticipating a pullback to rebuy. Although a pullback has yet to develop, the FTSE's overbought readings via the RSI indicator suggest a pullback may not be far away. FTSE daily chart   Source: TradingView Source: Tradingview. The figures stated are as of 21 May, 2024. Past performance is not a reliable indicator of future performance. This report does not contain and is not to be taken as containing any financial product advice or financial product recommendation.     This information has been prepared by IG, a trading name of IG Markets Limited. In addition to the disclaimer below, the material on this page does not contain a record of our trading prices, or an offer of, or solicitation for, a transaction in any financial instrument. IG accepts no responsibility for any use that may be made of these comments and for any consequences that result. No representation or warranty is given as to the accuracy or completeness of this information. Consequently any person acting on it does so entirely at their own risk. Any research provided does not have regard to the specific investment objectives, financial situation and needs of any specific person who may receive it. It has not been prepared in accordance with legal requirements designed to promote the independence of investment research and as such is considered to be a marketing communication. Although we are not specifically constrained from dealing ahead of our recommendations we do not seek to take advantage of them before they are provided to our clients. See full non-independent research disclaimer and quarterly summary.
    • Nyan Heroes is an innovative NFT game built on the Solana blockchain, designed to be a key player in the burgeoning "play-to-earn" metaverse. This project aims to combine high-quality gaming experiences with a robust, player-centric economic system supported by a comprehensive tokenomic structure. Game Mechanics and Player Interaction In Nyan Heroes, players can collect unique NFTs in the form of Nyans (cats) and their Guardian Robots. These NFTs are not merely collectibles; they are integral to the gameplay. Players use their Nyans and Guardian Robots to engage in battles against other players in a shooter-style action game. The game is designed to reward players for their participation through a variety of in-game activities such as completing tasks, winning battles, and progressing through adventure mode. As players immerse themselves in the game, they automatically contribute to and benefit from the player-based economy. Tokens are awarded as rewards, which players can use within the game or trade on external platforms. Expanding the NFT Collection Beyond the core gameplay, Nyan Heroes offers additional layers of engagement through its NFT ecosystem. Players have the opportunity to mint more Nyans, clone their Guardian Robots, and collect rare and unique weapons and skins. All these items can be traded in the marketplace, allowing players to diversify their collections and potentially profit from their gameplay. Significant Funding and Upcoming Developments Nyan Heroes has garnered significant financial backing, raising $13 million from prominent investors including Mechanism Capital, Delphi Ventures, and Shima Capital. This funding is a testament to the potential seen in the project's innovative approach to combining gaming and blockchain technology. In a recent announcement, Nyan Heroes revealed an upcoming airdrop for game players, which is expected to further enhance player engagement and expand the community. Additionally, NYAN deposits are now open on Bitget, with trading set to commence shortly, providing players and investors with new opportunities to engage with the game's economy. Nyan Heroes is set to make a significant impact on the play-to-earn gaming landscape. By delivering a high-quality gaming experience enriched with NFT mechanics and a player-driven economy, it aims to attract a wide audience of gamers and blockchain enthusiasts alike. With strong financial backing and an active roadmap for future developments, Nyan Heroes is poised to become a major player in the metaverse. 
×
×
  • Create New...
us