The cl-yahoo-finance Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-yahoo-finance Reference Manual

This is the cl-yahoo-finance Reference Manual, version 4.0, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:37:40 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction


* Common Lisp library for accessing Yahoo Finance quotes.

- Authors: Paul Nathan, Chris Howey, riktam,  Neil T. Dantam
- Licence: LLGPL

Documentation available at:

https://github.com/pnathan/cl-yahoo-finance/wiki

** TODO
*** Clean up the data returned by Yahoo
**** Destring stringifed data
**** Convert N/A results to Nil
**** clean out the HTML tags floating around

** Notes
Contributions welcome.

*** Attributions:

Historical data retrieval observed at https://github.com/herval/yahoo-finance


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-yahoo-finance

Maintainer

Paul Nathan

Author

Paul Nathan

License

LLGPL

Description

CL interface to Yahoo’s finance API

Long Description

Common Lisp interface to Yahoo’s finance API, available over the web. See usage.lisp for example code.

Version

4.0

Dependencies
Source

cl-yahoo-finance.asd (file)

Component

cl-yahoo-finance.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-yahoo-finance.asd

Location

cl-yahoo-finance.asd

Systems

cl-yahoo-finance (system)


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-yahoo-finance/cl-yahoo-finance.lisp

Parent

cl-yahoo-finance (system)

Location

cl-yahoo-finance.lisp

Packages

cl-yahoo-finance

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *proxy*

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Macros

Macro: with-proxy (PROXY-VALUE) &body BODY

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Functions

Function: read-current-company-info SYMBOL-LIST &key PROXY

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: read-current-data SYMBOL-OR-SYMBOL-LIST &key PROXY

Returns a list of hash tables

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: read-current-data-from-csv SYMBOL-OR-SYMBOL-LIST &key PROXY

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: read-current-options SYMBOL-LIST &key 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.

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: read-historical-data SYMBOL-STRING START-DATE END-DATE &key HISTORICAL-TYPE 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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: read-historical-splits SYMBOL-STRING START-DATE END-DATE &key PROXY

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *columns*

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Special Variable: *debug*

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Special Variable: *float-columns*
Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Special Variable: *historical-modes*

Keys into historical quotes

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Special Variable: +string-to-keyword-map+

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: concat-list SEQ

Concatenates a list of strings

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: convert-from-column-strings DATASET
Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: convert-stringy-table-to-keyword HASH-TABLE

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: current-data-cleanse HASH-TABLE
Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: enquote-string STRING

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: getassoc ITEM ALIST &key KEY TEST
Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: 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.

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: parse-float STRING

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: parse-hashtable TABLE

Clean and destringify entries in the hash table.

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: read-ratio-to-lisp STR
Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: request-csv-historical-stock SYMBOL-STRING URL HISTORICAL-TYPE START-DATE END-DATE

Core reading function for reading historical data

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: request-yql-info TABLE SYMBOL-LIST

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: request-yql-options-info SYMBOL-LIST
Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: request-yql-quant-info SYMBOL-LIST
Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: request-yql-stock-info SYMBOL-LIST
Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: 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.

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: strcat &rest STRINGS
Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: to-s THING

Converts ‘thing‘ to a string using FORMAT

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: 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.

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: 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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)

Function: yason-stock-quotes-parse QUOTE-STRING

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

Package

cl-yahoo-finance

Source

cl-yahoo-finance.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-yahoo-finance.asd: The cl-yahoo-finance<dot>asd file
cl-yahoo-finance/cl-yahoo-finance.lisp: The cl-yahoo-finance/cl-yahoo-finance<dot>lisp file

F
File, Lisp, cl-yahoo-finance.asd: The cl-yahoo-finance<dot>asd file
File, Lisp, cl-yahoo-finance/cl-yahoo-finance.lisp: The cl-yahoo-finance/cl-yahoo-finance<dot>lisp file

L
Lisp File, cl-yahoo-finance.asd: The cl-yahoo-finance<dot>asd file
Lisp File, cl-yahoo-finance/cl-yahoo-finance.lisp: The cl-yahoo-finance/cl-yahoo-finance<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   E   F   G   M   P   R   S   T   W   Y  
Index Entry  Section

C
concat-list: Internal functions
convert-from-column-strings: Internal functions
convert-stringy-table-to-keyword: Internal functions
current-data-cleanse: Internal functions

E
enquote-string: Internal functions

F
Function, concat-list: Internal functions
Function, convert-from-column-strings: Internal functions
Function, convert-stringy-table-to-keyword: Internal functions
Function, current-data-cleanse: Internal functions
Function, enquote-string: Internal functions
Function, getassoc: Internal functions
Function, parse-entry: Internal functions
Function, parse-float: Internal functions
Function, parse-hashtable: Internal functions
Function, read-current-company-info: Exported functions
Function, read-current-data: Exported functions
Function, read-current-data-from-csv: Exported functions
Function, read-current-options: Exported functions
Function, read-historical-data: Exported functions
Function, read-historical-splits: Exported functions
Function, read-ratio-to-lisp: Internal functions
Function, request-csv-historical-stock: Internal functions
Function, request-yql-info: Internal functions
Function, request-yql-options-info: Internal functions
Function, request-yql-quant-info: Internal functions
Function, request-yql-stock-info: Internal functions
Function, safely-read-from-string: Internal functions
Function, strcat: Internal functions
Function, to-s: Internal functions
Function, yason-quant-parse: Internal functions
Function, yason-stock-options-parse: Internal functions
Function, yason-stock-quotes-parse: Internal functions

G
getassoc: Internal functions

M
Macro, with-proxy: Exported macros

P
parse-entry: Internal functions
parse-float: Internal functions
parse-hashtable: Internal functions

R
read-current-company-info: Exported functions
read-current-data: Exported functions
read-current-data-from-csv: Exported functions
read-current-options: Exported functions
read-historical-data: Exported functions
read-historical-splits: Exported functions
read-ratio-to-lisp: Internal functions
request-csv-historical-stock: Internal functions
request-yql-info: Internal functions
request-yql-options-info: Internal functions
request-yql-quant-info: Internal functions
request-yql-stock-info: Internal functions

S
safely-read-from-string: Internal functions
strcat: Internal functions

T
to-s: Internal functions

W
with-proxy: Exported macros

Y
yason-quant-parse: Internal functions
yason-stock-options-parse: Internal functions
yason-stock-quotes-parse: Internal functions

Jump to:   C   E   F   G   M   P   R   S   T   W   Y  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
S  
Index Entry  Section

*
*columns*: Internal special variables
*debug*: Internal special variables
*float-columns*: Internal special variables
*historical-modes*: Internal special variables
*proxy*: Exported special variables

+
+string-to-keyword-map+: Internal special variables

S
Special Variable, *columns*: Internal special variables
Special Variable, *debug*: Internal special variables
Special Variable, *float-columns*: Internal special variables
Special Variable, *historical-modes*: Internal special variables
Special Variable, *proxy*: Exported special variables
Special Variable, +string-to-keyword-map+: Internal special variables

Jump to:   *   +  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-yahoo-finance: The cl-yahoo-finance system
cl-yahoo-finance: The cl-yahoo-finance package

P
Package, cl-yahoo-finance: The cl-yahoo-finance package

S
System, cl-yahoo-finance: The cl-yahoo-finance system

Jump to:   C   P   S