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.
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
(ql:quickload :cl-tradier)
(asdf:test-system :cl-tradier-test)
(cl-tradier:initialize-tradier-session :environment :sandbox :access-token "<secret-access-token>")
(cl-tradier:get-quotes :aapl)
Builds successfully on sbcl linux. Other enivironments not tested but expected to work across all common operating systems and CL implementations.
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.
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)