Jump to content

wki

Community Member
  • Posts

    26
  • 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)

0

Reputation

  1. Hi, thanks, but there is no "Consumer Goods" FTSE350 tradeable epic though?
  2. Any idea what shares make up each FTSE 350 "epic" sector?
  3. 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...
  4. 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?
  5. 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?
  6. 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.
  7. 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))
  8. 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.
  9. Thanks @jlz. Most of that is over my head but I will, as always, chip away.
  10. 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!
  11. sorry meant "update the stops when a level is reached'. Here is a link to my fleshed out question:
  12. That allows me to do a simple update of a position but not "update a position when a level is reached' ...?
  13. Through the rest api, the ability to add additional stops and/or limits to existing orders if a level is hit. For example, I have a current sell order in place with a stop at 10,050. If the price moves down to say 9,950, I would like to move the stop quite close to say 9,960. I could achieve this if I could create another instruction on the platform that specifies the level and the stop, linked to the same order id. Also the ability to edit this additional instruction via the rest api. The original stop of 10,050 would still be in place but would be redundant as the 9,960 stop will be hit first. This would make my day.
  14. Hi. I have a trading strategy that I would like to execute but it involves moving the stop once when the price drops below a set threshold. Example: Current EURUSD price is at 10,000 (easy numbers) I put down a sell working order with the level set at 9,980 and a stop set at 9,990. The price drops to below 9,980 and the order is placed. As soon as the price drops further to 9,960 or below, the stop is moved close to the current price, i.e. it is moved from 9,990 to 9,965 Note this is a once-off move and a trailing stop won't (I don't think) give me what I need I monitor the price further and tap out if it reaches a lower profit taking level I am achieving this currently through another rest api process that watches the price every 1 minute and moves the stop when the threshold is hit, but I would like something more automated / on the platform itself as I often miss the intra-minute movements. I have considered a streaming approach but this can't be set up for limit setting right? Also considered using alerts but this is not (currently) part of the rest api. Can I achieve the above using the current IG rest api tools or even 3rd party tools? Thanks!
×
×
  • Create New...
us