Common Lisp Package: CL-YAHOO-FINANCE

README:

FUNCTION

Public

READ-CURRENT-COMPANY-INFO (SYMBOL-LIST &KEY (PROXY *PROXY*))

Reads the current company info and returns it as an a-list

READ-CURRENT-DATA (SYMBOL-OR-SYMBOL-LIST &KEY (PROXY *PROXY*))

Returns a list of hash tables

READ-CURRENT-DATA-FROM-CSV (SYMBOL-OR-SYMBOL-LIST &KEY (PROXY *PROXY*))

Pass in a list of symbols in strings; get a list of a-lists out. Useful if YQL bails on us

READ-CURRENT-OPTIONS (SYMBOL-LIST &KEY (PROXY *PROXY*))

Takes one or more symbols and returns a list of option hash tables. See yason-stock-options-parse for details on the data structure.

READ-HISTORICAL-DATA (SYMBOL-STRING START-DATE END-DATE &KEY (HISTORICAL-TYPE DAILY) (PROXY *PROXY*))

Start and end dates are 3-element lists mm/dd/yy Returns a list of hash tables. Keys are: Date Open High Low Close Volume Adj-Close

READ-HISTORICAL-SPLITS (SYMBOL-STRING START-DATE END-DATE &KEY (PROXY *PROXY*))

Start and end dates are 3-element lists mm/dd/yy Returns a list of hash tables. Keys are: Date Split

Private

CONCAT-LIST (SEQ)

Concatenates a list of strings

CONVERT-STRINGY-TABLE-TO-KEYWORD (HASH-TABLE)

Returns a new hash table with keywords as the keys instead of strings

ENQUOTE-STRING (STRING)

Surround `string` with double-quotes, suitable for passing to other systems.

PARSE-ENTRY (NAME STRING-VALUE)

Convert the STRING-VALUE to a more helpful type. Returns (values NEW-VALUE converted-p). The second value will be true if a conversion took place.

PARSE-FLOAT (STRING)

Return a float read from string, and the index to the remainder of string.

PARSE-HASHTABLE (TABLE)

Clean and destringify entries in the hash table.

REQUEST-CSV-HISTORICAL-STOCK (SYMBOL-STRING URL HISTORICAL-TYPE START-DATE END-DATE)

Core reading function for reading historical data

REQUEST-YQL-INFO (TABLE SYMBOL-LIST)

Calls out to the YQL online API to get info on the list of stock symbols

SAFELY-READ-FROM-STRING (STR &REST READ-FROM-STRING-ARGS)

Read an expression from the string STR, with *READ-EVAL* set to NIL. Any unsafe expressions will be replaced by NIL in the resulting S-Expression.

TO-S (THING)

Converts `thing` to a string using FORMAT

YASON-QUANT-PARSE (DATA-STRING)

Reads a JSON string assumed to be data from Yahoo.finance.quant and returns a hash-table of its data. "TwoMonthsAgo" is known to map to a HTML string sometimes.

YASON-STOCK-OPTIONS-PARSE (QUOTE-STRING)

Reads a string assumed to be Yahoo Finance options tables. Returns a list of hash tables. Each hash table has keys "symbol" and "option" symbol points out to the symbol desired; option points out a a hash table with the following keys openInt, vol, ask, bid, changeDir, change, lastPrice, strikePrice, type, symbol

YASON-STOCK-QUOTES-PARSE (QUOTE-STRING)

Reads a JSON string assumed to be Yahoo stock information and returns an a-list of its data

Undocumented

CONVERT-FROM-COLUMN-STRINGS (DATASET)

CURRENT-DATA-CLEANSE (HASH-TABLE)

GETASSOC (ITEM ALIST &KEY KEY (TEST #'EQL))

READ-RATIO-TO-LISP (STR)

REQUEST-YQL-OPTIONS-INFO (SYMBOL-LIST)

REQUEST-YQL-QUANT-INFO (SYMBOL-LIST)

REQUEST-YQL-STOCK-INFO (SYMBOL-LIST)

STRCAT (&REST STRINGS)

MACRO

Public

WITH-PROXY ((PROXY-VALUE) &BODY BODY)

Binds `proxy-value` to *proxy* for the duration of the macro

VARIABLE

Public

*PROXY*

HTTP proxy: Takes nil, address as string, or list containing address as string and port as integer

Private

*COLUMNS*

This a-list serves as keys for the Yahoo stock information for a given quote

*DEBUG*

Debugging parameter. Don't set it unless you're digging around

*HISTORICAL-MODES*

Keys into historical quotes

+STRING-TO-KEYWORD-MAP+

A-list mapping the strings returned by the YASON into keywords

Undocumented

*FLOAT-COLUMNS*