forked from jjttjj/trateg
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
awb99
committed
Sep 2, 2023
1 parent
f6640dc
commit 8969d0e
Showing
8 changed files
with
8,030 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
|
||
|
||
|
||
;; BYBIT UNIVERSE | ||
|
||
(def start-date-daily (tick/date-time "2018-11-01T00:00:00")) | ||
|
This file contains 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
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"]) | ||
|
||
; | ||
) |
This file contains 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
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] |
Oops, something went wrong.