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 ?
I thought I'd have a crack at this using yahoo finance watchlist scripts. I have attached file wlyh_20170209.zip which contains the following files:
symlist.csv: Contains symbols used to download delayed data for. Modify to suit your needs.
wlyh.pl: Perl watchlist script to fetch yahoo delayed data for symbols.
wlyh.py: Python(2.7 and 3+) watchlist script to fetch yahoo delayed data for symbols.
These scripts read symbols in from symlist.csv. Then every x seconds (variable sleepdur), download the corresponding delayed data from yahoo finance, clear the screen and display the results in the command prompt/terminal window. The variable "sleepdur" is currently set to 5 seconds, but you can change to suit your needs.
To run, open up the command prompt/terminal window and navigate to the directory where zip file was extracted, then run either script like so:
perl wlyh.pl
or
python wlyh.py
Every x seconds, it will clear the screen and display the information with the following columns:
Symbol, Last Price, Volume(Daily), Last Time, Prev Close
I tested this successfully on Windows 7 and Linux.
Let me know if it works for you and thoughts?
Cheers,
Andrew.