Unofficial Common Lisp Tradier API client
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
LICENSE.txt
README.md
api.lisp
cl-tradier.asd
cl-tradier.lisp
conditions.lisp
define-tradier-endpoint.lisp
endpoints.lisp
package.lisp
tradier-request.lisp

README.md

cl-tradier

Unofficial Common Lisp Tradier API client. See api.lisp and the Tradier API documentation at https://developer.tradier.com/documentation for details on the API calls.

Installation

Currently not available on quicklisp. To install locally (assuming default quicklisp installation):

cd ~/quicklisp/local-projects/
git clone https://github.com/brewski82/cl-tradier.git

Loading and Testing

(ql:quickload :cl-tradier)
(asdf:test-system :cl-tradier-test)

Example Usuage

(cl-tradier:initialize-tradier-session :environment :sandbox :access-token "<secret-access-token>")
(cl-tradier:get-quotes :aapl)

Build Status

Builds successfully on sbcl linux. Other enivironments not tested but expected to work across all common operating systems and CL implementations.

Usage Status

Used successfully for market data requests. Other requests not yet used but expected to work. If not, please report the issue or submit a pull request.

Extending

This client aims for extensibility. If, for example, you want to have all calls decode json strings into Common Lisp objects, load the cl-json package and add the following to your project:

(defclass my-tradier-session (cl-tradier:tradier-session) ())

(defmethod cl-tradier:process-tradier-response :around ((tradier-session my-tradier-session) response &key &allow-other-keys)
  (let* ((response-values (multiple-value-list (call-next-method)))
         (response-body (first response-values))
         (processed-response-body (cl-json:decode-json-from-string response-body)))
    (setf (first response-values) processed-response-body)
    (values-list response-values)))

(cl-tradier:initialize-tradier-session :environment :sandbox :access-token "<secret-access-token>" :tradier-session-class 'my-tradier-session)