Skip to content

Commit

Permalink
datafeeds quandl and kibot added
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Sep 2, 2023
1 parent f6640dc commit 8969d0e
Show file tree
Hide file tree
Showing 8 changed files with 8,030 additions and 7 deletions.
11 changes: 9 additions & 2 deletions app/demo/src/demo/data_import/demo_bybit.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@

(defn demo-bybit []
;(get-history-page "D" (ta.helper.date/days-ago 10) 3 "ETHUSD")
(-> (get-history-page "D" (ta.helper.date/days-ago 10) 3 "ETHUSD")
(-> (get-history-page
{:symbol "ETHUSD"
:frequency "D"
:start (ta.helper.date/days-ago 10)
:limit 3
})
(clojure.pprint/print-table))
#_(-> (get-history "D" (ta.helper.date/days-ago 20) "ETHUSD")
(clojure.pprint/print-table))

;
)
)

(demo-bybit)
1 change: 1 addition & 0 deletions app/demo/src/demo/data_import/import_bybit.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@




;; BYBIT UNIVERSE

(def start-date-daily (tick/date-time "2018-11-01T00:00:00"))
Expand Down
77 changes: 77 additions & 0 deletions app/demo/src/demo/data_import/import_quandl.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
(ns demo.data-import.import-quandl
(:require
[tablecloth.api :as tc]
[ta.warehouse :as wh]
[ta.warehouse.since-importer :as since-importer]
[ta.data.quandl :as quandl]
[ta.helper.date :refer [parse-date]]
))

(defn quandl-result->ds [{:keys [data columns]}]
(-> (tc/dataset data {:column-names columns})
(tc/rename-columns {"Date" :date
"Open" :open
"High" :high
"Low" :low
"Settle" :close
"Volume" :volume
"Prev. Day Open Interest" :open-interest-1
})
(tc/convert-types :date [[:local-date-time parse-date]])
))


(defn quandl-get-since-ds [_frequency _since symbol]
(let [quandl-result (quandl/cfuture-request symbol {})]
(quandl-result->ds quandl-result)
))

(def dax-full (quandl/cfuture-request "FDAX" {}))
(def dax-2023 (quandl/cfuture-request "FDAX" {:start_date "2021-06-25" }))

(def gold-2023 (quandl/cfuture-request "GC" {:start_date "2021-01-01"}))

(quandl/quandl-metadata "CHRIS/EUREX_FDAX1" {})

(quandl/quandl-metadata "CHRIS/CME_GC1" {})


(quandl/quandl-metadata "SCF/CBOE_VX2N" {})


; WTI spot
(quandl/quandl-metadata "EIA/PET_RWTC_D" {})





gold-2023

quandl-result
quandl-result-2023

(quandl-result->ds quandl-result)



;(quandl-get-since-ds "D" "2021-01-01" "FDAX")



#_(defn get-alphavantage-daily [symbols]
(let [start-date-dummy nil]
(since-importer/init-symbols
:stocks alphavantage-get-since-ds "D"
start-date-dummy symbols)))


; ********************************************************************************************+
(comment

(def symbols (wh/load-list "test"))

; (get-alphavantage-daily ["QQQ" "SPY" "TLT"])

;
)
26 changes: 26 additions & 0 deletions app/demo/src/notebook/playground/techml.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(ns notebook.playground.techml)



;(require '[tech.v3.datatype.casting :as casting])
;(println @casting/valid-datatype-set)

[:byte :int8 :int :uint64 :uint8 :long :int32 :short :int64, :uint16 :big-integer :uint32 :int16
:boolean :bool
:float32 :decimal :double :float :float64
:char :text :string,
:native-buffer :array-buffer
:keyword
:uuid
:object
:list
:dataset
:persistent-map :persistent-vector :persistent-set
:bitmap :tensor

:local-date-time :epoch-milliseconds :time-microseconds :packed-instant
:days :seconds :microseconds :time-nanoseconds :epoch-days :instant
:zoned-date-time :epoch-nanoseconds :years :time-seconds :epoch-microseconds
:milliseconds :local-time :nanoseconds :duration :packed-duration
:hours :epoch-seconds :packed-local-date :epoch-hours :time-milliseconds
:weeks :local-date :packed-local-time]
Loading

0 comments on commit 8969d0e

Please sign in to comment.