Jump to content

bug-or-feature

Community Member
  • Posts

    75
  • Joined

  • Last visited

  • Days Won

    12

Posts posted by bug-or-feature

  1. Hi @KoketsoIG

    Does "per app" refer to the IG application, or to a user client application?

    My reading of the limits was that "per app" referred to a user application, ie API key. When you request an API key, you have to provide an application name - I always assumed that was the app.

    It used to be possible to have multiple API keys per user account, so in that context it would make sense to have a different limit per application AND per account.

    But (as I understand it) now it is only possible to have one API key per account, ie one for LIVE and one for DEMO. So now, that limit of 60 per application makes no sense.

    Could you check with the API team please? And maybe ask them to update the page showing the limits, so it is more clear?

  2. You don't need a calculator, the IG web interface tells you everything you need to know. For any spread bet, before you actually press the Place Deal button, the interface shows you what the margin of your proposed bet would be. For example:

    Screenshot2024-04-11at16_40_53.thumb.png.af3f8fad54c134adae0313df04f31be4.png

    This shows that if I were to make a bet of £1 per point selling the Dow at 38300, the margin would be £1914.87. That amount is less than my available balance of £41k, so the bet would be accepted. Conversely

     

    Screenshot2024-04-11at16_42_42.thumb.png.6a13bf3825cfece9f16a070e99c1698a.png

     

    In this case I want to make the same bet, but at £100 per point. The margin would be £191k, which is way too much compared to what I have available. If I pressed the Place Deal button here, I'd see the same error message about insufficient balance that you saw.

    Different markets have different margin rates. You can see the margin rate for a market by clicking on the Info tab

    Screenshot2024-04-11at16_44_26.thumb.png.870310d8bbeab69775a19ee383bbb305.png

    It also shows how the margin amount is calculated, and a potential way to reduce it using guaranteed stops.

    There is more information here:

    https://www.ig.com/uk/help-and-support/spread-betting-and-cfds/margin/what-is-leverage-and-margin

     

     

  3. 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
  4. @BCC are you logging in to a Spread bet or CFD demo account? To stream a CFD epic, you will need to log in with a CFD account. User name, password and API key will be the same as with a spreadbet account - but account ID will be different. Its the 'acc-number' param in trading-ig.

    The sample works fine for me with the epic IX.D.NASDAQ.IFD.IP in a CFD demo account, but fails like your snippet when logged into a spread bet account

    • Like 2
  5. There is a serious problem with the DEMO spread bet environment. Over the weekend 7 of my 12 open spreadbet positions disappeared. There is nothing in the history or activity views to say why. There are no closing transactions. On the My IG Dashboard view, my balance and P&L shows as if all the positions still exist; but on the platform view, the balance and P&L is valid for only the visible positions.

    My problem sounds like @Ravager's issue here. But I know that it is nothing to do with the app, or any browser or caching issue, as the REST API reports the same position list, missing the the same bets.

    Is anyone from IG looking into this, or know what is going on?

  6. UPDATE:

    I told the Web API team about this issue via their email address webapisupport@ig.com. Their reponse was: we know about this, it's not a bug. The excuse was

    Quote

    I understand that this is not 'consistent' with the history section but i looked through both reference documents and we also did not specify which dealID it is supposed to return

    and then

    Quote

    This was how it is when we developed the API and we can submit this as a feedback to them to consider for future improvements.

    My interpretation is: it has been like that since the API was released. They know its wrong, but to change it now would admit the mistake.

    So for now, the laborious workaround mentioned above is the only solution.

    Maybe if enough people make a noise about it, they will fix it. But I doubt it

  7. 13 hours ago, Varma said:

    How can i know more details about how much allowance i got and allowed please?

    There's a section in the FAQ about the API limits

    https://labs.ig.com/faq

    Note that the limits described there are for the LIVE environment. The limits in DEMO are different, less, and variable. In my experience though, you still get 10,000 price points per week for historical data

     

    • Like 1
  8. I've done a bit more digging - I think there is a bug. And now I understand the issue as described by @SZZ It looks to me like the /confirms endpoint returns the wrong dealId when closing a position. The Streaming API also reports the wrong dealId from the TRADE Subscription. They both respond with the dealId of the opening trade instead of the closing trade.

    The correct closing trade dealId is reported by the /history/activity endpoint, and by the /history/transactions endpoint. So there is a workaround for your issue right now @SZZ . Once your trade is closed, look at the response of the /history/activity endpoint. Find the dealId where the affectedDealId is the ID of the opening trade, and description is "Positions/s closed: XXXXXXXX". Then lookup that dealId in the response of the /history/transactions endpoint, with field name reference.

    I have reported this to the webapi team, will post any updates here

    • Like 1
  9. Hmm not sure what is going on. My previous examples were market orders. I just tried a working order, and the transaction response contained the full 15 character reference field, eg DIAAAANXXXXXXXX

    Maybe someone from IG can explain. Why does the reference field in the /history/transactions response sometimes contain the full dealId, and sometimes just the portion after DIAAAAN?

     

  10. INFO:trading_ig.rest:GET '/history/activity/', resp 200
                       date                  marketName                      epic  period    level direction           dealId
    0   2023-11-10T05:45:05           Oil - Brent Crude        EN.D.LCO.Month6.IP  JAN-24   8034.5      SELL  DIAAAANP68C8YAQ
    1   2023-11-09T05:45:11  10-Year T-Note Decimalised  IR.D.10YEAR100.Month2.IP  DEC-23    10845       BUY  DIAAAANPPY34SAG
    
    
    INFO:trading_ig.rest:GET '/history/transactions', resp 200
                openDateUtc              dateUtc              instrumentName  period openLevel closeLevel   size        reference profitAndLoss
    0   2023-10-27T18:59:23  2023-11-10T05:45:05           Oil - Brent Crude  JAN-24      8923     8034.5  +0.53  DIAAAANP68C8YAQ      £-470.91
    1   2023-09-26T17:17:04  2023-11-09T05:45:11  10-Year T-Note Decimalised  DEC-23   10814.4      10845  -0.62  DIAAAANPPY34SAG       £-18.97

    The dealId field from the activities endpoint (/history/activity) matches the reference field from the transactions endpoint (/history/transactions)

    • Like 1
×
×
  • Create New...
us