Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Stock Exchange info Via TCP

 [1/5] from: tim:johnsons-web at: 9-Nov-2001 11:24


Hello All: I'd like to attempt to retrieve Stock Exchange info via tcp. Does any know of any public I.P. Addresses and port numbers that I could try? AND Are there any example scripts? TIA -- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [2/5] from: ddalley:idirect at: 9-Nov-2001 23:57


Hello, Tim: On 09-Nov-01, Tim Johnson wrote:
> Hello All: I'd like to attempt to retrieve Stock Exchange info > via tcp.
No problem. Lots of people do it, daily.
> Does any know of any public I.P. Addresses and port numbers > that I could try?
That depends on what data you want, the form in which it is available and how much you want to pay to acquire it - nothing or subscription fees?
> AND > Are there any example scripts?
For the most part, if the data is a web page or produced via a web page, simple REBOL read URL or net GET commands should be all that is necessary to gain the info. Give it a try at your favourite sites: Yahoo!, MSN, CNN, a stock exchange, whatever. -- ---===///||| Donald Dalley |||\\\===--- The World of AmiBroker Support http://webhome.idirect.com/~ddalley UIN/ICQ#: 65203020

 [3/5] from: tim:johnsons-web at: 9-Nov-2001 20:19


Thanks Donald: It looks like you're recommend 'http. Why not make it easy! Thanks On Fri, Nov 09, 2001 at 11:57:10PM +0000, Donald Dalley wrote:
> Hello, Tim: > On 09-Nov-01, Tim Johnson wrote:
<<quoted lines omitted: 20>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [4/5] from: ddalley:idirect at: 10-Nov-2001 1:45


----- Original Message ----- From: "Tim Johnson" <[tim--johnsons-web--com]> To: <[rebol-list--rebol--com]> Sent: Saturday, November 10, 2001 12:19 AM Subject: [REBOL] Re: Stock Exchange info Via TCP
> Thanks Donald: > It looks like you're recommend 'http. > Why not make it easy! > Thanks
You're welcome, Tim. At the risk of going a little off topic, now: One thing I'd recommend to >anyone< doing this (getting large amounts of any data off the web) is to take it easy with the amount of data you request, how you request it and how frequently you request it. From my experience, people are watching you use web robots, and I have seen a number of quote servers disappear, partly because of abuse by some people excessively accessing "free" data. Remember, there's no such thing as a free lunch - somebody pays, somehow. That somebody always sees to be you, the user, one way or another. For instance, there are plenty of programs which mine Yahoo! for >all< EOD quotes on the US exchanges. Just because you can do this doesn't mean you should. Besides, there are other more efficient ways to get this amount of info, without abusing Yahoo! Please, guys and gals, don't spoil it for others - tread lightly. Thanks for listening!

 [5/5] from: m:s:licholai:ieee at: 12-Nov-2001 22:03


Hello Tim, I was just working on something similar, and would be happy to share my solution. Below is a function which gets stock data from yahoo. Although this function gets historic data via http, it might be of some use to you. Writing the result of this function will give you a .csv file with the historic data, which can then be imported into a spreadsheet or directly manipulated. Good Luck, Matt Licholai -------------------------------------------------------------------------------- REBOL [ Title: "Download stock data as csv" Date: 10-Nov-2001 Author: "Matt Licholai" Email: [M--S--Licholai--ieee--org] File: %get-csv.r Rights: "(C) Matt Licholai 2001 " Version: 0.1 History: [0.1 ["Initial version"]] Purpose: {Get stock data in csv format from Yahoo} Comment: {Downloads historic data for a stock between two date from Yahoo. Gets date, open, high, low, close and volume in a comma separated format for each date within the range. Newest data is at the top of the string.} Usage: {Example: get-stock-csv "IBM" 01-Oct-2001 now/date } Language: 'English ] get-stock-csv: func [ {Download historic data for the specified stock from Yahoo} ticker [string!] "Stock ticker" start [date!] "data start date" end [date!] "data end date" /local yahoo-url data-path refiner codes id val ][ yahoo-url: http://chart.yahoo.com data-path: copy "table.csv?" refiner: func [ str [string!] const var ][ append append append append str "&" :const "=" :var ] codes: compose [ s (ticker) a start/month b start/day c start/year d end/month e end/day f end/year g d q q y 0 z (:ticker) x .csv ] foreach [id val] codes [ refiner data-path id val ] read yahoo-url/:data-path ]

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted