Skip to content

brewski82/cl-tradier

Repository files navigation

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)

About

Unofficial Common Lisp Tradier API client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published