Jump to content
  • 0

2 demo accounts through API (Python)


FatFoss

Question

Hello!
I have an issue by using two demo accounts. It seems that the server does not work correctly through the "ig-trading" library for Python. Request for 1st account has been sent to 2nd account and request for 2nd account has been sent to 1st account. Returns no positions. How can I control sessions at request time for each of the accounts?

Edited by FatFoss
Link to comment

7 answers to this question

Recommended Posts

  • 0
13 hours ago, FatFoss said:

Hello!
I have an issue by using two demo accounts. It seems that the server does not work correctly through the "ig-trading" library for Python. Request for 1st account has been sent to 2nd account and request for 2nd account has been sent to 1st account. Returns no positions. How can I control sessions at request time for each of the accounts?

Hi @FatFoss, could you please clarify if the issue is only occurring on the Python API, or if it is happening on the companion too?

Thanks - Arvin

Link to comment
  • 0

It relates to Python API. There is no way to work with two different accounts in prallel in the companion, so everything works well there. The problem is when I start using multiple instances of the IGService() class from the "ig-trading" library. It seems that server confuses the requests when I send orders and I can not get positions (there are positions actually)

3 hours ago, ArvinIG said:

Hi @FatFoss, could you please clarify if the issue is only occurring on the Python API, or if it is happening on the companion too?

Thanks - Arvin

 

Link to comment
  • 0
53 minutes ago, FatFoss said:

It relates to Python API. There is no way to work with two different accounts in prallel in the companion, so everything works well there. The problem is when I start using multiple instances of the IGService() class from the "ig-trading" library. It seems that server confuses the requests when I send orders and I can not get positions (there are positions actually)

 

Hi @FatFoss, for further assistance on Python and IG please check the github page : https://github.com/ig-python .

If this page doesn't help please contact us at helpdesk@ig.com.sg with some screenshots, our helpdesk and IT team will be able to assist you further if necessary.

Thank you - Arvin

Link to comment
  • 0
3 hours ago, ArvinIG said:

Hi @FatFoss, for further assistance on Python and IG please check the github page : https://github.com/ig-python .

If this page doesn't help please contact us at helpdesk@ig.com.sg with some screenshots, our helpdesk and IT team will be able to assist you further if necessary.

Thank you - Arvin

I wrote to github yesturday. They are silent for now. Thank you for your help

Link to comment
  • 0
On 09/07/2021 at 11:34, FatFoss said:

I wrote to github yesturday. They are silent for now. Thank you for your help

Did you get any further with this? I'm coding in c# and will have the same problem looking at the code, I'm going to try and copy the api to a new solution under a different name, so will need to do this for each extra account I want to connect to it seems

Link to comment
  • 0
2 minutes ago, CoolCold said:

you need to switch account if you are using 1 api key with 2 accounts

So it's possible to have 2 api keys and connect to them independently?.

I had a look at the new authentication, I can't remember it exactly off the top of my head but it seemed like I could maybe get two independent conversation context or whatever it is.

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

    • I am also new to this platform.  I also have a question related to spread betting for UK tax. IG always specifically mention spread betting is exempt from capital gain tax and stamp duty but never mention income tax. Does anyone know for sure if the profits and losses in spread betting need to be reported as income?  If so, should it be the net P&L for positions that are closed within the tax year?
    • Understanding the Repo Market: A Simple Guide Imagine you have a valuable watch, but you need some quick cash to pay for a surprise expense. You go to a pawnshop and offer your watch as collateral for a short-term loan. The pawnshop gives you the cash, and you agree to buy back your watch the next day, paying a little extra for the service. This is essentially how the repo market works in the financial world. What Is the Repo Market? The repo market (short for repurchase agreement market) is a crucial part of the financial system where banks and other financial institutions borrow and lend money to each other, usually overnight. They use high-quality securities, like government bonds, as collateral to secure these loans. How Does It Work? The Borrower (Seller): Needs cash for a short period. The Lender (Buyer): Has extra cash and wants to earn a small return with minimal risk. Collateral: High-quality assets like government securities are used to secure the loan. The Process: Step 1: The borrower sells securities to the lender and receives cash. Step 2: Both parties agree that the borrower will repurchase the same securities at a future date (often the next day) at a slightly higher price. Step 3: The difference in price represents the interest paid for the loan. Why Is the Repo Market Important? Liquidity Management: It allows financial institutions to manage their day-to-day cash needs efficiently. Low Risk: Using high-quality collateral reduces the risk for lenders. Interest Rates Influence: The repo market helps central banks implement monetary policy by influencing short-term interest rates. Economic Stability: A smooth repo market ensures that money flows effectively through the financial system, supporting lending and investment. Real-World Impact Banks and Businesses: They rely on the repo market to meet short-term funding needs, which helps them operate smoothly. Consumers: While not directly involved, consumers benefit from the stability and liquidity that the repo market provides to the overall economy. Central Banks: Institutions like the Federal Reserve use the repo market as a tool to control money supply and maintain financial stability. Key Takeaways Short-Term Borrowing: The repo market is all about short-term loans, often just overnight. Secured Loans: Loans are backed by high-quality collateral, reducing risk. Essential Function: It keeps the financial system liquid and stable, much like oil in a car engine. In Summary: The repo market is like a financial "pawnshop" for big institutions. It allows banks and other entities to quickly get cash by temporarily exchanging securities, ensuring that money keeps moving through the economy. Understanding the repo market helps explain how financial institutions manage liquidity and how central banks influence interest rates to maintain economic stability. Analyst Peter Mathers TradingLounge™  Source: tradinglounge.com 
    • I've been thinking about how gamers can easily advertise their creations, and what a platform designed for that would look like. This led me to do some research, and I found something interesting. During my search, Google brought up Cros, which is described as the world's most advanced in-game advertising platform. Cross allows advertisers to reach gamers through intrinsic in-game ads that enhance the experience, while also enabling developers to monetize their games without disrupting gameplay. One key aspect is the CROS token—central to Cross's economy. The token powers staking, payments, governance, and validation within the platform. Users can earn and trade CROS by participating in the ecosystem or get it pre-market on Bitget before live trading begins on the 23rd. What do you think of this innovation?
×
×
  • Create New...
us