Jump to content
  • 0

Stream API never response with these epics (HS50 CFD)


madeinquant

Question

Stream API never response with these epics (HS50 CFD), Please feel free to comment.
Thank you
1. IX.D.HANGSENG.IFM.IP",
2. IX.D.HANGSENG.IFD.IP",
3. IX.D.HANGSENG.FWM3.IP",
4. IX.D.HANGSENG.IFU.IP",
 
There is a source code in python (trading_ig) for your reference.
No response of stream data
# A simple function acting as a Subscription listener
def on_prices_update(item_update😞
# print("price: %s " % item_update)
print("{stock_name:<19}: Time {UPDATE_TIME:<8} - "
"Bid {BID:>5} - Ask {OFFER:>5}".format(
stock_name=item_update["name"], **item_update["values"]))
ig_service = IGService(config.username,
config.password,
config.api_key,
config.acc_type,
acc_number=config.acc_number)
 
ig_stream_service = IGStreamService(ig_service)
ig_stream_service.create_session()
 
subscription_prices = Subscription(
mode="MERGE",
 
items=[
"IX.D.HANGSENG.IFM.IP",
"IX.D.HANGSENG.IFD.IP",
"IX.D.HANGSENG.FWM3.IP",
"IX.D.HANGSENG.IFU.IP",
], # sample spreadbet epics
 
 
fields=["UPDATE_TIME", "BID", "OFFER", "CHANGE", "MARKET_STATE"],
)
 
# Adding the "on_price_update" function to Subscription
subscription_prices.addlistener(on_prices_update)
 
# Registering the Subscription
sub_key_prices = ig_stream_service.ls_client.subscribe(subscription_prices)
 
INFO:root:Creating new v2 session for user 'IGCFDEMO' at 'https://demo-api.ig.com/gateway/deal'
INFO:root:POST '/session', resp 200
INFO:trading_ig.stream:Starting connection with https://demo-apd.marketdatasystems.com
balance: {'pos': 1, 'name': 'ACCOUNT:Z528CN', 'values': {'AVAILABLE_CASH': '19901.90'}}
----------HIT CR TO UNSUBSCRIBE AND DISCONNECT FROM LIGHTSTREAMER-----------
 
Link to comment

4 answers to this question

Recommended Posts

  • 0
3 hours ago, madeinquant said:
Stream API never response with these epics (HS50 CFD), Please feel free to comment.
Thank you
1. IX.D.HANGSENG.IFM.IP",
2. IX.D.HANGSENG.IFD.IP",
3. IX.D.HANGSENG.FWM3.IP",
4. IX.D.HANGSENG.IFU.IP",
 
There is a source code in python (trading_ig) for your reference.
No response of stream data
# A simple function acting as a Subscription listener
def on_prices_update(item_update😞
# print("price: %s " % item_update)
print("{stock_name:<19}: Time {UPDATE_TIME:<8} - "
"Bid {BID:>5} - Ask {OFFER:>5}".format(
stock_name=item_update["name"], **item_update["values"]))
ig_service = IGService(config.username,
config.password,
config.api_key,
config.acc_type,
acc_number=config.acc_number)
 
ig_stream_service = IGStreamService(ig_service)
ig_stream_service.create_session()
 
subscription_prices = Subscription(
mode="MERGE",
 
items=[
"IX.D.HANGSENG.IFM.IP",
"IX.D.HANGSENG.IFD.IP",
"IX.D.HANGSENG.FWM3.IP",
"IX.D.HANGSENG.IFU.IP",
], # sample spreadbet epics
 
 
fields=["UPDATE_TIME", "BID", "OFFER", "CHANGE", "MARKET_STATE"],
)
 
# Adding the "on_price_update" function to Subscription
subscription_prices.addlistener(on_prices_update)
 
# Registering the Subscription
sub_key_prices = ig_stream_service.ls_client.subscribe(subscription_prices)
 
INFO:root:Creating new v2 session for user 'IGCFDEMO' at 'https://demo-api.ig.com/gateway/deal'
INFO:root:POST '/session', resp 200
INFO:trading_ig.stream:Starting connection with https://demo-apd.marketdatasystems.com
balance: {'pos': 1, 'name': 'ACCOUNT:Z528CN', 'values': {'AVAILABLE_CASH': '19901.90'}}
----------HIT CR TO UNSUBSCRIBE AND DISCONNECT FROM LIGHTSTREAMER-----------
 

Hi @madeinquant

Thanks for reaching out. You can also share this with webapisupport@ig.com for more assistance. This team is created to assist with Web API issues. All the best, OfentseIG

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
  • General Statistics

    • Total Topics
      23,625
    • Total Posts
      97,020
    • Total Members
      44,187
    • Most Online
      7,522
      10/06/21 10:53

    Newest Member
    Nolan
    Joined 05/12/23 12:41
  • Posts

    • Considering the impact of Lisk LSK to Defi and web3 and the simplicity it provides for developers to transfer skills more rapidly for the building of dApps. Am confident that the token will highly be sought after. I have deposited some of my LSK on Bitget to share from the Airdrop event to celebrate the listing of the token on the CEX.
    • Thanks for sharing @THT I highly doubt that gold will fall below the 1900 level, which is the lowest support level on the monthly time frame. Right now, the current pullback in gold is nothing but a FALSE MOVE to the downside which ALWAYS takes place before a REAL BREAKOUT. This FALSE MOVE can last no longer than 1-3 time units and is simply the REQUIRED movement of markets. Gold is setting up for a major sling-shot to the upside.
    • Had this on my chart (daily) for a long time Next watch for one of those 2 scenarios above unfolding THT
×
×
  • Create New...
us