This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun rolling-map (n func list &optional (sequence '()) (return '())) | |
(cond ((eq list '()) return) | |
(t (setq sequence (append sequence (list (car list)))) | |
(if (> (length sequence) n) (setq sequence (cdr sequence))) | |
(setq return (append return (list (apply func sequence)))) | |
(rolling-map n func (cdr list) sequence return)))) | |
(defun average (&rest list) (/ (apply '+ list) (length list))) | |
(rolling-map 3 'list '(1 1 2 3 5 8 13 21 34)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ql:quickload :cl-kraken) | |
(setq cl-kraken/src/globals::*api-key* "my api key") | |
(setq cl-kraken/src/globals::*api-secret* "my api secret") | |
; public market data | |
(cl-kraken::request "Time") | |
(cl-kraken::request "Ticker" :params '(("pair" . "XXBTZEUR"))) | |
; private user data | |
(cl-kraken::request "Balance" :post t) | |
(cl-kraken::request "TradeBalance" :params '(("asset" . "ZEUR")) :post t) |
NewerOlder