A collection of implementations for managing a simple security portfolio centered around SICP 6.001.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
931 B

#!/bin/env gxi
(import :std/format
:std/text/json)
(map (lambda (x) (load x)) `("api-output.scm" "portfolio.scm"))
#| Yahoo Finance Headers
headers: '( ("x-rapidapi-host" . "apidojo-yahoo-finance-v1.p.rapidapi.com")
("x-rapidapi-key" . "98c32048f8mshe6f4d8a686ddce9p18cc5ajsn8b8888e7e256") )
|#
; Initialize the db connections we'll need to store stockminder's config
; Things like stock symbols, favourite functions, timing preferences, etc.
;(define local-db
; (sql-connect sqlite-open "test.sqlite") )
; The procedure we'll use to iterate through portfolio values and add symbols
; to our stocklist
;(define actions
; `((get-assets . "SELECT * FROM stocksymbols;")
; ;(add-asset . ,(format "INSERT INTO stocksymbols (symbol, shares) VALUES ('~a', ~d);" stock-symbol number-of-shares)))
; ) )
;(display (portfolio local-db `get-assets))
;(display (portfolio local-db `add-asset (list "VIU" 10)))