Jump to content


Community Member
  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

wki's Achievements

Occasional Contributor

Occasional Contributor (2/10)



  1. Response from IG help via email confirming streaming shares data is not posslbe : Unfortunately, we are unable to provide historical or streaming of pricing for Equities (Shares) and certain indexes, this is due to restrictions by our data providers. This restriction applies to all markets that generate the "error.unauthorised.access.to.equity.exception" error, including but not limited to: Equities China A50 Index Singapore Blue Chip Index India 50 Index Volatility Index
  2. I don't understand - the epics for live and demo accounts are the same, e.g. KA.D.HSBA.DAILY.IP is the same for demo and live?
  3. Thanks, I can see it is there, but I cannot see what FTSE 350 sector it belongs to. I am looking for the breakdown of all the sectors, ie what stocks belong to each of the following "epic" sectors (that sheet is useful but it doesnt tie back 100%): FTSE 350 Banks FTSE 350 General Retailers FTSE 350 Mining FTSE 350 Oil and Gas Producers FTSE 350 Real Estate Investment Trusts FTSE 350 Aerospace and Defence FTSE 350 Household Goods and Home Construction FTSE 350 Beverages FTSE 350 Chemicals etc
  4. Hi, thanks, but there is no "Consumer Goods" FTSE350 tradeable epic though?
  5. Any idea what shares make up each FTSE 350 "epic" sector?
  6. I'm trying to find a list of shares that behind each FTSE350 epic, e.g. KB.D.DRINKS.DAILY.IP (Beverages) I was pointed to this IG website but the index names don't correspond exactly with the epics on IG Trading: https://www.ig.com/uk/markets-stock-screener For example, it says that Compass Group PLC is in Hotels & Entertainment Services but there is no Hotels & Entertainment Services FTSE350 index...? Thanks...
  7. Thats a very useful resource, but this page and the available FTSE350 indices don't quite line up. For example, it says that Compass Group PLC is in Hotels & Entertainment Services but there is no Hotels & Entertainment Services FTSE350 index...? Would be good to know for example what shares are behind the various epics, e.g. KB.D.DRINKS.DAILY.IP (Beverages) - any idea if this is available somewhere?
  8. There was this great request to be able to interact with Alerts via the REST API: https://labs.ig.com/comment/1138 I cannot seem to comment on this but it would be great if this can be added to the API suite (i.e. CREATE/EDIT/DELETE Alerts). I agree that there are numerous use cases for this approach, the most compelling being able to use this endpoint where streaming data is not available (ie streamingPricesAvailable = false which is the case for all stocks? 😪). So programmatically create a new alert if e.g. HSBC reaches X, programmatically watch my inbox and then programmatically do something if alert is triggered. Yes/no/maybe?
  9. Hi, I am struggling to figure out why IG Rest API is asking for a stop_level when I am trying to update the trailing stop. This is the python code I am trying to run: response = ig_service.update_open_position(deal_id='XXXXX',limit_level=None, stop_level=None, trailing_stop=True, trailing_stop_distance=25, trailing_stop_increment=1) print(response) output: IGException: {"errorCode":"validation.not-null-conditional-set-value.request"} If I change stop_level to: latest price - (the trailing_stop_distance + trailing_stop_increment) then it updates ok, but why do I need to specify the stop_level if its a trailing stop? The stop_level will change as the price goes up and it shouldn't make a difference what I provide as stop_level surely, as long is the trailing_stop_distance meets the rules? Am I missing something? When I created the trade via the create_open_position endpoint, I had stop_level = None and a stop_distance and it went through ok.
  10. ok I think I have figured out how to extract the value from lightstreamer and then do something with it. I pass the streaming item through a function that extracts the appropriate value from the item, adds this value to a list, looks at the last item of that list and does something based on that value. Seems to work ok... lst = [] def add2list(item): val = float(item['values']['OFFER']) lst.append(val) if lst[-1] < 58000: return print('below',lst[-1]) else: return print('above',lst[-1]) session = IgStreamingSession(api_key, account_id, rest_api_username, rest_api_password) subscription = LightstreamerSubscription('MERGE', ['MARKET:CS.D.BITCOIN.TODAY.IP'], ['UPDATE_TIME', 'BID', 'OFFER']) subscription.addlistener(lambda item: add2list(item))
  11. Hi, I am trying to update the stops for an existing order using the streaming API. Working / fledgling code so far: import time from ig_streaming_client import IgStreamingSession from lightstreamer_client import LightstreamerSubscription api_key = ""; account_id = ''; rest_api_username = ""; rest_api_password = "" session = IgStreamingSession(api_key, account_id, rest_api_username, rest_api_password) subscription = LightstreamerSubscription('MERGE', ['MARKET:CS.D.BITCOIN.TODAY.IP'], ['UPDATE_TIME', 'BID', 'OFFER']) print(subscription.addlistener(lambda item: print(item['values']['OFFER']))) #####thisone session.subscribe(subscription) time.sleep(10) session.log_out() This successfully prints out the latest offer prices for 10 seconds. However, I am struggling to figure out how to take the real time offer values from the streaming data and check against my current order stopLevel and change the stopLevel if the streaming offer price goes below my threshold. For the #####thisone line above, I am needing something like this (58000 is my threshold): if subscription.addlistener(lambda item: item['values']['OFFER']) < 58000: ig_service.update_open_position(limit_level = None, stop_level = 58100, deal_id = dealId) Massive gap in my streaming api knowledge I accept but any help would be appreciated. There does not seem to be much out there that uses streaming data and "does stuff" with the outputs, apart from displaying in an html of course.
  12. Thanks @jlz. Most of that is over my head but I will, as always, chip away.
  13. Ok great, so I can use the streaming api for this. Assuming I can do this over multiple forex pairs? I have the streaming api working in that I have been able to print to screen in Python but have hit a bit of a block going beyond that, wasn't sure if it was possible. Any resources you can recommend on how to do this? I'll look myself but if you have anything at your fingertips, that would be 👍 Thanks!
  14. sorry meant "update the stops when a level is reached'. Here is a link to my fleshed out question:
  • Create New...