• Australian (ASX) Stock Market Forum

Hello and welcome to Aussie Stock Forums!

To gain full access you must register. Registration is free and takes only a few seconds to complete.

Already a member? Log in here.

Access ASX database via Programming

Discussion in 'Trading/Investing Resources' started by SirRumpole, Jan 28, 2017.

  1. SirRumpole

    SirRumpole

    Posts:
    12,437
    Likes Received:
    2,053
    Joined:
    Mar 26, 2014
    Hi all,

    I'm sure this must have been done by some/many of you.

    I can write code in Visual Basic, Perl , Python etc at an amateur level and I want to access the ASX website and grab the current price of a stock(s) and display it in a desktop window (windows 10), doing this at intervals while the program is running.

    Can anyone give me a few pointers to the easiest way to do this ?
     
  2. pixel

    pixel DIY Trader

    Posts:
    5,200
    Likes Received:
    319
    Joined:
    Feb 3, 2010
    PM (convo) sent.
     
  3. luutzu

    luutzu

    Posts:
    7,956
    Likes Received:
    1,050
    Joined:
    Apr 21, 2014
    That's a bit strange for a car racing game ;)

    Is it possible to get these data feed, for free?
     
  4. SirRumpole

    SirRumpole

    Posts:
    12,437
    Likes Received:
    2,053
    Joined:
    Mar 26, 2014
    The info is in the AX web site it's a matter of accessing it programatically.
     
  5. Gringotts Bank

    Gringotts Bank

    Posts:
    6,099
    Likes Received:
    508
    Joined:
    Jun 30, 2007
    ASX data is 20 min delayed.

    Better through your broker.

    Pixel, can you share here please?
     
  6. ThingyMajiggy

    ThingyMajiggy

    Posts:
    1,609
    Likes Received:
    43
    Joined:
    Nov 12, 2007
    Does it HAVE to be from the ASX website? I just wrote this, it will ask you for the ticker and get the current price from yahoo finance, then will refresh every 20 minutes. Very simple.

    Code:
    from yahoo_finance import Share
    import time
    
    stock = input("Enter ASX ticker: ")
    yahoo_ticker = Share(stock.upper() + ".AX")
    
    while True:
        yahoo_ticker.refresh()
        print("Current price:", yahoo_ticker.get_price(), end='\r')
        time.sleep(1200)
    
    
    Using Python 3.
    Obviously you need the yahoo_finance module(pip install yahoo_finance). From there you could look into putting it in a GUI if you really want the "it's own window" thing.
     
  7. SirRumpole

    SirRumpole

    Posts:
    12,437
    Likes Received:
    2,053
    Joined:
    Mar 26, 2014

    Yes I decided to use Yahoo finance too and your program is just the ticker ! Thanks.
     
  8. Gringotts Bank

    Gringotts Bank

    Posts:
    6,099
    Likes Received:
    508
    Joined:
    Jun 30, 2007
    yahoo's not accurate for mid and small caps
     
  9. ThingyMajiggy

    ThingyMajiggy

    Posts:
    1,609
    Likes Received:
    43
    Joined:
    Nov 12, 2007
    For what symbols? You mean even just for a single price grab like this, or you referring to historical data? Checking some now and they're all accurate so far.
     
  10. Gringotts Bank

    Gringotts Bank

    Posts:
    6,099
    Likes Received:
    508
    Joined:
    Jun 30, 2007
    Good question. Certainly for historical data there are holes and wrong quotes and missing chunks of data everywhere. For live quotes I don't know.
     
  11. Gringotts Bank

    Gringotts Bank

    Posts:
    6,099
    Likes Received:
    508
    Joined:
    Jun 30, 2007
    If Yahoo live quotes were reliable, that would be awesome. I've always thought of them as crap, but I'll try tomorrow with Amiquote, since it's just a click away.
     
  12. pixel

    pixel DIY Trader

    Posts:
    5,200
    Likes Received:
    319
    Joined:
    Feb 3, 2010
    I write all my programs in the old Excel Macro language, Office 97's XLM.
    The address I use is -
    Equity.Dataset="http://www.asx.com.au/asx/markets/equityPrices.do?by=asxCodes&asxCodes="&Current.Code
    =IF(NOT(ISERROR(OPEN(Equity.Dataset,,TRUE))))
    ... grab the data you're after and
    =CLOSE(FALSE)
    =END.IF()

    The problem is however, ASX don't like spiders and bots obtaining free data, even though it's 20 minutes delayed. So they keep changing the layout or blocking/ slowing down bot access.
    (If you have an ancient version of Office 97, that works the fastest, going straight to the URL.)
     
    luutzu and Gringotts Bank like this.
  13. ThingyMajiggy

    ThingyMajiggy

    Posts:
    1,609
    Likes Received:
    43
    Joined:
    Nov 12, 2007
    Yeah I've known them to be not so reliable when it comes to historical data, but should be fine with a single price check. Anyway was just trying to help, can always do a web scrape with Python or use Pixel's excel version :)
     
  14. Beej

    Beej

    Posts:
    1,115
    Likes Received:
    0
    Joined:
    May 6, 2007
    If you want live / non delayed data, shell out for E*Trade Pro (or ANZ Investing Pro or whatever they call it nowadays) - which is free if you do a few trades a month anyway. It comes with an Excel add-in that will give live quotes, trades etc fed directly into an Excel spreadsheet in something getting close to "real-time" (at the retail level anyway). Can include option data as well if you want. Anyway it's easy really easy to use.
     
  15. Wysiwyg

    Wysiwyg Everyone wants money

    Posts:
    8,421
    Likes Received:
    258
    Joined:
    Aug 8, 2006
    An option that I have queried a few times before is to tap the streaming quotes (O,H,L,C,V) from a CFD or Meta Trader platform. They give the data free so a universal plug in like DDE with backfilling capability would be great. Most stuff is programmable so it's just knowing how. This is someones request ....

     
  16. pixel

    pixel DIY Trader

    Posts:
    5,200
    Likes Received:
    319
    Joined:
    Feb 3, 2010
    So I have noticed too. (Likewise the website that provides long history on company dividends.)
    ... so I've spent most of today mucking around with a new program that queries the ASX website for last price and only the recent dividend data. That's at least as credible as can be.
     
  17. skc

    skc Goldmember

    Posts:
    8,260
    Likes Received:
    288
    Joined:
    Aug 12, 2008
    I find live quotes (i.e. 20min delayed) generally reliable from Yahoo, but every now and then (like twice a year) it will not have up-to-date prices, as if some guy forgot to switch that functionality on.

    Are you referring to WebIress? Plenty of brokers offer this. Some charge you a bit extra for the Excel add-in... and from memory there's a limit of how many live quotes it can feed at any one time. So grabbing ASX100 last price should be fine, grabbing ASX100 full market depth might be a struggle.

    Interactive broker would another option.
     
  18. Habakkuk

    Habakkuk

    Posts:
    142
    Likes Received:
    20
    Joined:
    Sep 26, 2014
    ANZ offer 2 trading platforms: WebIRESS and "Pro" which used to be called E*Trade Pro and cost $79.95 a month.
    Maybe it's now called ANZ Pro.
    URL= https://shareinvesting.anz.com/TradingTools/ActiveTraders/Default.aspx?Tab=pnlPro&area=news
    I've tried it about 18 months ago for one month. There are some features superior to IRESS, like it's not limited to 10 charts and 5 custom watchlists. And Excel support is built-in. It's quite good, some similarities with Paritech Pulse, but there were some features that were deal-breakers for me. Can't remember the details, though.
    There is no free trial available from ANZ but there is for Pulse from Open Markets, which is superior in my opinion.
     
  19. skc

    skc Goldmember

    Posts:
    8,260
    Likes Received:
    288
    Joined:
    Aug 12, 2008
  20. Gringotts Bank

    Gringotts Bank

    Posts:
    6,099
    Likes Received:
    508
    Joined:
    Jun 30, 2007
    Amscott offer NetIress for $800pcm, as well as a few other Iress products not available elsewhere.

    It's just the Etrade platform since ANZ own them.
     
Loading...

Share This Page