Skip to content

Commit

Permalink
series import improved
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Sep 3, 2023
1 parent 3e9785f commit 4bfb5aa
Show file tree
Hide file tree
Showing 26 changed files with 346 additions and 189 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ app/demo/certs
/output/db/random/*.nippy.gz
/output/db/shuffled/*.nippy.gz
/output/tradingview-charts
/output/
.clj-kondo
*~
\#*\#
Expand Down
8 changes: 6 additions & 2 deletions app/demo/src/services-docs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
; :ns-require {:start (modular.require/require-namespaces
; (:ns-clj (deref (clip/ref :config))))}

:alphavantage {:start (ta.data.alphavantage/set-key!

:symbol-lists {:start (ta.warehouse.symbollist/add-lists-to-db)
}

:alphavantage {:start (ta.data.api.alphavantage/set-key!
(:alphavantage (clip/ref :secrets)))}

:quandl {:start (ta.data.quandl/set-key!
:quandl {:start (ta.data.api.quandl/set-key!
(:quandl (clip/ref :secrets)))}

; goldly service returns {:ns-clj :webly ; this are used to start clj-require and webly
Expand Down
2 changes: 2 additions & 0 deletions app/demo/src/services-task.edn
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@

:quandl {:start (ta.data.quandl/set-key!
(:quandl (clip/ref :secrets)))}

:symbol-lists {:start (ta.warehouse.symbollist/add-lists-from-config-to-db)}
;
}}
6 changes: 5 additions & 1 deletion app/demo/src/ta-config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
:ta {:warehouse {:list "../resources/symbollist/"
:series {:crypto "../../output/db/crypto/"
:stocks "../../output/db/stocks/"
:fx "../../output/db/fx/"
:futures "../../output/db/futures/"
:random "../../output/db/random/"
:shuffled "../../output/db/shuffled/"}
:lists ["crypto"
Expand All @@ -81,7 +83,9 @@
"equity-region-country"
"equity-sector-industry"
"equity-style"
"test"]}
"test"
"futures-kibot"
]}
:tradingview {:charts-path "../../output/tradingview-charts/"
:template-path "../resources/tradingview-templates/"
:marks-path "../../data/"}}
Expand Down
166 changes: 83 additions & 83 deletions app/resources/symbollist/futures-kibot.edn
Original file line number Diff line number Diff line change
@@ -1,104 +1,104 @@
[
;; agriculture
{:symbol "BO" :name "CONTINUOUS SOYBEAN OIL CONTRACT" :category :future}
{:symbol "C" :name "CONTINUOUS CORN CONTRACT" :category :future}
{:symbol "S" :name "CONTINUOUS SOYBEANS CONTRACT" :category :future}
{:symbol "W" :name "CONTINUOUS WHEAT CONTRACT" :category :future}
{:symbol "SM" :name "CONTINUOUS SOYBEAN MEAL CONTRACT" :category :future}
{:symbol "RR" :name "CONTINUOUS ROUGH RICE CONTRACT" :category :future}
{:symbol "O" :name "CONTINUOUS OATS CONTRACT" :category :future}
{:symbol "LE" :name "CONTINUOUS LIVE CATTLE CONTRACT" :category :future}
{:symbol "HE" :name "CONTINUOUS LEAN HOGS CONTRACT" :category :future}
{:symbol "GF" :name "CONTINUOUS FEEDER CATTLE CONTRACT" :category :future}
{:symbol "BO0" :kibot "BO" :name "CONTINUOUS SOYBEAN OIL CONTRACT" :category :future}
{:symbol "C0" :kibot "C" :name "CONTINUOUS CORN CONTRACT" :category :future}
{:symbol "S0" :kibot "S" :name "CONTINUOUS SOYBEANS CONTRACT" :category :future}
{:symbol "W0" :kibot "BO":name "CONTINUOUS WHEAT CONTRACT" :category :future}
{:symbol "SM0" :kibot "SM" :name "CONTINUOUS SOYBEAN MEAL CONTRACT" :category :future}
{:symbol "RR0" :kibot "RR" :name "CONTINUOUS ROUGH RICE CONTRACT" :category :future}
{:symbol "O0" :kibot "O" :name "CONTINUOUS OATS CONTRACT" :category :future}
{:symbol "LE0" :kibot "LE" :name "CONTINUOUS LIVE CATTLE CONTRACT" :category :future}
{:symbol "HE0" :kibot "HE" :name "CONTINUOUS LEAN HOGS CONTRACT" :category :future}
{:symbol "GF0" :kibot "GF" :name "CONTINUOUS FEEDER CATTLE CONTRACT" :category :future}
;; mini
{:symbol "YC" :name "CONTINUOUS MINI CORN CONTRACT" :category :future}
{:symbol "YW" :name "CONTINUOUS MINI WHEAT CONTRACT" :category :future}
{:symbol "YK" :name "CONTINUOUS MINI SOYBEAN CONTRACT" :category :future}
{:symbol "YC0" :kibot "YC" :name "CONTINUOUS MINI CORN CONTRACT" :category :future}
{:symbol "YW0" :kibot "YW" :name "CONTINUOUS MINI WHEAT CONTRACT" :category :future}
{:symbol "YK0" :kibot "YK" :name "CONTINUOUS MINI SOYBEAN CONTRACT" :category :future}

;; energy
{:symbol "CL" :name "CONTINUOUS CRUDE OIL CONTRACT" :category :future}
{:symbol "NG" :name "CONTINUOUS NATURAL GAS CONTRACT" :category :future}
{:symbol "RB" :name "CONTINUOUS RBOB GASOLINE CONTRACT" :category :future}
{:symbol "BZ" :name "CONTINUOUS BRENT CRUDE OIL LAST DAY CONTRACT" :category :future}
{:symbol "HO" :name "CONTINUOUS NEW YORK HARBOR ULSD CONTRACT" :category :future}
{:symbol "AC" :name "CONTINUOUS ETHANOL CONTRACT" :category :future}
{:symbol "CL0" :kibot "CL" :name "CONTINUOUS CRUDE OIL CONTRACT" :category :future}
{:symbol "NG0" :kibot "NG" :name "CONTINUOUS NATURAL GAS CONTRACT" :category :future}
{:symbol "RB0" :kibot "RB" :name "CONTINUOUS RBOB GASOLINE CONTRACT" :category :future}
{:symbol "BZ0" :kibot "BZ" :name "CONTINUOUS BRENT CRUDE OIL LAST DAY CONTRACT" :category :future}
{:symbol "HO0" :kibot "HO" :name "CONTINUOUS NEW YORK HARBOR ULSD CONTRACT" :category :future}
{:symbol "AC0" :kibot "AC" :name "CONTINUOUS ETHANOL CONTRACT" :category :future}
;; mini
{:symbol "QM" :name "CONTINUOUS E-MINI CRUDE OIL CONTRACT" :category :future}
{:symbol "QG" :name "CONTINUOUS E-MINI NATURAL GAS CONTRACT" :category :future}
{:symbol "QM0" :kibot "QM" :name "CONTINUOUS E-MINI CRUDE OIL CONTRACT" :category :future}
{:symbol "QG0" :kibot "QG" :name "CONTINUOUS E-MINI NATURAL GAS CONTRACT" :category :future}

;; interest rates
{:symbol "FF" :name "CONTINUOUS 30 DAY FED FUND CONTRACT" :category :future}
{:symbol "TU" :name "CONTINUOUS 2 YR US TREASURY NOTE CONTRACT" :category :future}
{:symbol "FV" :name "CONTINUOUS 5 YR US TREASURY NOTE CONTRACT" :category :future}
{:symbol "TY" :name "CONTINUOUS 10 YR US TREASURY NOTE CONTRACT" :category :future}
{:symbol "US" :name "CONTINUOUS 30 YR US TREASURY BOND CONTRAC" :category :future}
{:symbol "UB" :name "CONTINUOUS ULTRA US TREASURY BOND CONTRACT" :category :future}
{:symbol "TN" :name "CONTINUOUS ULTRA 10 YR US TREASURY NOTE CONTRACT" :category :future}
{:symbol "FF0" :kibot "FF" :name "CONTINUOUS 30 DAY FED FUND CONTRACT" :category :future}
{:symbol "TU0" :kibot "TU" :name "CONTINUOUS 2 YR US TREASURY NOTE CONTRACT" :category :future}
{:symbol "FV0" :kibot "FV" :name "CONTINUOUS 5 YR US TREASURY NOTE CONTRACT" :category :future}
{:symbol "TY0" :kibot "TY" :name "CONTINUOUS 10 YR US TREASURY NOTE CONTRACT" :category :future}
{:symbol "US0" :kibot "US" :name "CONTINUOUS 30 YR US TREASURY BOND CONTRAC" :category :future}
{:symbol "UB0" :kibot "UB" :name "CONTINUOUS ULTRA US TREASURY BOND CONTRACT" :category :future}
{:symbol "TN0" :kibot "TN" :name "CONTINUOUS ULTRA 10 YR US TREASURY NOTE CONTRACT" :category :future}

;; metals
{:symbol "GC" :name "CONTINUOUS GOLD CONTRACT" :category :future}
{:symbol "SI" :name "CONTINUOUS SILVER CONTRACT" :category :future}
{:symbol "PL" :name "CONTINUOUS PLATINUM CONTRACT" :category :future}
{:symbol "PA" :name "CONTINUOUS PALLADIUM CONTRACT" :category :future}
{:symbol "HG" :name "CONTINUOUS COPPER CONTRACT" :category :future}
{:symbol "GC0" :kibot "GC" :name "CONTINUOUS GOLD CONTRACT" :category :future}
{:symbol "SI0" :kibot "SI" :name "CONTINUOUS SILVER CONTRACT" :category :future}
{:symbol "PL0" :kibot "PL" :name "CONTINUOUS PLATINUM CONTRACT" :category :future}
{:symbol "PA0" :kibot "PA" :name "CONTINUOUS PALLADIUM CONTRACT" :category :future}
{:symbol "HG0" :kibot "HG" :name "CONTINUOUS COPPER CONTRACT" :category :future}
;; mini
{:symbol "QO" :name "CONTINUOUS E-MINI GOLD CONTRACT" :category :future}
{:symbol "MGC" :name "CONTINUOUS MICRO GOLD CONTRACT" :category :future}
{:symbol "QI" :name "CONTINUOUS E-MINI SILVER CONTRACT" :category :future}
{:symbol "SIL" :name "CONTINUOUS MICRO SILVER CONTRACT" :category :future}
{:symbol "QO0" :kibot "QO" :name "CONTINUOUS E-MINI GOLD CONTRACT" :category :future}
{:symbol "MGC0" :kibot "MGC" :name "CONTINUOUS MICRO GOLD CONTRACT" :category :future}
{:symbol "QI0" :kibot "QI" :name "CONTINUOUS E-MINI SILVER CONTRACT" :category :future}
{:symbol "SIL0" :kibot "SIL" :name "CONTINUOUS MICRO SILVER CONTRACT" :category :future}

;; currencies
{:symbol "EU" :name "CONTINUOUS EURO FX CONTRACT" :category :future}
{:symbol "JY" :name "CONTINUOUS JAPANESE YEN CONTRACT" :category :future}
{:symbol "BP" :name "CONTINUOUS BRITISH POUND CONTRACT" :category :future}
{:symbol "AD" :name "CONTINUOUS AUSTRALIAN DOLLAR CONTRACT" :category :future}
{:symbol "CD" :name "CONTINUOUS CANADIAN DOLLAR CONTRACT" :category :future}
{:symbol "SF" :name "CONTINUOUS SWISS FRANC CONTRACT" :category :future}
{:symbol "PX" :name "CONTINUOUS MEXICAN PESO CONTRACT" :category :future}
{:symbol "NE" :name "CONTINUOUS NEW ZEALAND DOLLAR CONTRACT" :category :future}
{:symbol "RF" :name "CONTINUOUS EURO FX/SWISS FRANC CONTRACT" :category :future}
{:symbol "SIR" :name "CONTINUOUS INR/USD STANDARD CONTRACT" :category :future}
{:symbol "RU" :name "CONTINUOUS RUSSIAN RUBLE CONTRACT" :category :future}
{:symbol "RA" :name "CONTINUOUS SOUTH AFRICAN RAND CONTRACT" :category :future}
{:symbol "RP" :name "CONTINUOUS EURO FX/BRITISH POUND CONTRACT" :category :future}
{:symbol "BR" :name "CONTINUOUS BRAZILIAN REAL CONTRACT" :category :future}
{:symbol "RY" :name "CONTINUOUS EURO FX/JAPANESE YEN CONTRACT" :category :future}
{:symbol "SEK" :name "CONTINUOUS SWEDISH KRONA CONTRACT" :category :future}
{:symbol "AJY" :name "CONTINUOUS AUSTRALIAN $/JAPANESE YEN CONTRACT" :category :future}
{:symbol "NOK" :name "CONTINUOUS NORWEGIAN KRONE CONTRACT" :category :future}
{:symbol "PJY" :name "CONTINUOUS BRITISH PD/JAPANSE YEN CONTRACT" :category :future}
{:symbol "ECD" :name "CONTINUOUS EURO FX/CANADIAN DOLLAR CONTRACT" :category :future}
{:symbol "EAD" :name "CONTINUOUS EURO FX/AUSTRALIAN $ CONTRACT" :category :future}
{:symbol "EU0" :kibot "EU" :name "CONTINUOUS EURO FX CONTRACT" :category :future}
{:symbol "JY0" :kibot "JY" :name "CONTINUOUS JAPANESE YEN CONTRACT" :category :future}
{:symbol "BP0" :kibot "BP" :name "CONTINUOUS BRITISH POUND CONTRACT" :category :future}
{:symbol "AD0" :kibot "AD" :name "CONTINUOUS AUSTRALIAN DOLLAR CONTRACT" :category :future}
{:symbol "CD0" :kibot "CD" :name "CONTINUOUS CANADIAN DOLLAR CONTRACT" :category :future}
{:symbol "SF0" :kibot "SF" :name "CONTINUOUS SWISS FRANC CONTRACT" :category :future}
{:symbol "PX0" :kibot "PX" :name "CONTINUOUS MEXICAN PESO CONTRACT" :category :future}
{:symbol "NE0" :kibot "NE" :name "CONTINUOUS NEW ZEALAND DOLLAR CONTRACT" :category :future}
{:symbol "RF0" :kibot "RF" :name "CONTINUOUS EURO FX/SWISS FRANC CONTRACT" :category :future}
{:symbol "SIR0" :kibot "SIR" :name "CONTINUOUS INR/USD STANDARD CONTRACT" :category :future}
{:symbol "RU0" :kibot "RU" :name "CONTINUOUS RUSSIAN RUBLE CONTRACT" :category :future}
{:symbol "RA0" :kibot "RA" :name "CONTINUOUS SOUTH AFRICAN RAND CONTRACT" :category :future}
{:symbol "RP0" :kibot "RP" :name "CONTINUOUS EURO FX/BRITISH POUND CONTRACT" :category :future}
{:symbol "BR0" :kibot "BR" :name "CONTINUOUS BRAZILIAN REAL CONTRACT" :category :future}
{:symbol "RY0" :kibot "RY" :name "CONTINUOUS EURO FX/JAPANESE YEN CONTRACT" :category :future}
{:symbol "SEK0" :kibot "SEK" :name "CONTINUOUS SWEDISH KRONA CONTRACT" :category :future}
{:symbol "AJY0" :kibot "AKY" :name "CONTINUOUS AUSTRALIAN $/JAPANESE YEN CONTRACT" :category :future}
{:symbol "NOK0" :kibot "NOK" :name "CONTINUOUS NORWEGIAN KRONE CONTRACT" :category :future}
{:symbol "PJY0" :kibot "PJY" :name "CONTINUOUS BRITISH PD/JAPANSE YEN CONTRACT" :category :future}
{:symbol "ECD0" :kibot "ECD" :name "CONTINUOUS EURO FX/CANADIAN DOLLAR CONTRACT" :category :future}
{:symbol "EAD0" :kibot "EAD" :name "CONTINUOUS EURO FX/AUSTRALIAN $ CONTRACT" :category :future}
;; mini
{:symbol "ME" :name "CONTINUOUS E-MINI EURO FX CONTRACT" :category :future}
{:symbol "JE" :name "CONTINUOUS E-MINI JAPANESE YEN CONTRACT" :category :future}
{:symbol "M6E" :name "CONTINUOUS E-MICRO EUR/USD CONTRACT" :category :future}
{:symbol "M6A" :name "CONTINUOUS E-MICRO AUD/USD CONTRACT" :category :future}
{:symbol "MCD" :name "CONTINUOUS E-MICRO CAD/USD CONTRACT" :category :future}
{:symbol "M6B" :name "CONTINUOUS E-MICRO GBP/USD CONTRACT" :category :future}
{:symbol "MSF" :name "CONTINUOUS E-MICRO CHF/USD CONTRACT" :category :future}
{:symbol "ME0" :kibot "ME" :name "CONTINUOUS E-MINI EURO FX CONTRACT" :category :future}
{:symbol "JE0" :kibot "JE" :name "CONTINUOUS E-MINI JAPANESE YEN CONTRACT" :category :future}
{:symbol "M6E0" :kibot "M6E" :name "CONTINUOUS E-MICRO EUR/USD CONTRACT" :category :future}
{:symbol "M6A0" :kibot "M6A" :name "CONTINUOUS E-MICRO AUD/USD CONTRACT" :category :future}
{:symbol "MCD0" :kibot "MCD" :name "CONTINUOUS E-MICRO CAD/USD CONTRACT" :category :future}
{:symbol "M6B0" :kibot "M6B" :name "CONTINUOUS E-MICRO GBP/USD CONTRACT" :category :future}
{:symbol "MSF0" :kibot "MSF" :name "CONTINUOUS E-MICRO CHF/USD CONTRACT" :category :future}

;; stock index
{:symbol "VX" :name "CONTINUOUS CBOE VOLATILITY INDEX (VIX) CONTRACT" :category :future}
{:symbol "BTC" :name "CONTINUOUS BITCOIN FUTURES CONTRACT" :category :future}
{:symbol "NIY" :name "CONTINUOUS NIKKEI 225 YEN INDEX CONTRACT" :category :future}
{:symbol "NKD" :name "CONTINUOUS NIKKEI 225 DOLLAR INDEX CONTRACT" :category :future}
{:symbol "VX0" :kibot "VX" :name "CONTINUOUS CBOE VOLATILITY INDEX (VIX) CONTRACT" :category :future}
{:symbol "BTC0" :kibot "BTC" :name "CONTINUOUS BITCOIN FUTURES CONTRACT" :category :future}
{:symbol "NIY0" :kibot "NIY" :name "CONTINUOUS NIKKEI 225 YEN INDEX CONTRACT" :category :future}
{:symbol "NKD0" :kibot "NKD" :name "CONTINUOUS NIKKEI 225 DOLLAR INDEX CONTRACT" :category :future}

;; mini
{:symbol "ES" :name "CONTINUOUS E-MINI S&P 500 CONTRACT" :category :future}
{:symbol "YM" :name "CONTINUOUS E-MINI DOW JONES $5 CONTRACT" :category :future}
{:symbol "NQ" :name "CONTINUOUS E-MINI NASDAQ 100 CONTRACT" :category :future}
{:symbol "RTY" :name "CONTINUOUS E-MINI RUSSELL 2000 CONTRACT" :category :future}
{:symbol "EMD" :name "CONTINUOUS E-MINI S&P MIDCAP 400 CONTRACT" :category :future}
{:symbol "XAE" :name "CONTINUOUS E-MINI S&P 500 ENERGY SECTOR CONTRACT" :category :future}
{:symbol "XAF" :name "CONTINUOUS E-MINI S&P 500 FINANCIAL SECTOR CONTRACT" :category :future}
{:symbol "XAU" :name "CONTINUOUS E-MINI S&P 500 UTILITIES SECTOR CONTRACT" :category :future}
{:symbol "XAV" :name "CONTINUOUS E-MINI S&P 500 HEALTH CARE SECTOR CONTRACT" :category :future}
{:symbol "XAK" :name "CONTINUOUS E-MINI S&P 500 TECHNOLOGY SECTOR CONTRACT" :category :future}
{:symbol "XAP" :name "CONTINUOUS E-MINI S&P 500 CONSUMER STAPLES CONTRACT" :category :future}
{:symbol "XAY" :name "CONTINUOUS E-MINI S&P 500 CONSUMER DISCRETIONARY CONTRACT" :category :future}
{:symbol "XAI" :name "CONTINUOUS E-MINI S&P 500 INDUSTRIAL SECTOR CONTRACT" :category :future}
{:symbol "XAB" :name "CONTINUOUS E-MINI S&P 500 MATERIALS SECTOR CONTRACT" :category :future}
{:symbol "ES0" :kibot "ES" :name "CONTINUOUS E-MINI S&P 500 CONTRACT" :category :future}
{:symbol "YM0" :kibot "YM" :name "CONTINUOUS E-MINI DOW JONES $5 CONTRACT" :category :future}
{:symbol "NQ0" :kibot "NQ" :name "CONTINUOUS E-MINI NASDAQ 100 CONTRACT" :category :future}
{:symbol "RTY0" :kibot "RTY" :name "CONTINUOUS E-MINI RUSSELL 2000 CONTRACT" :category :future}
{:symbol "EMD0" :kibot "EMD" :name "CONTINUOUS E-MINI S&P MIDCAP 400 CONTRACT" :category :future}
{:symbol "XAE0" :kibot "XAE" :name "CONTINUOUS E-MINI S&P 500 ENERGY SECTOR CONTRACT" :category :future}
{:symbol "XAF0" :kibot "XAF" :name "CONTINUOUS E-MINI S&P 500 FINANCIAL SECTOR CONTRACT" :category :future}
{:symbol "XAU0" :kibot "XAU" :name "CONTINUOUS E-MINI S&P 500 UTILITIES SECTOR CONTRACT" :category :future}
{:symbol "XAV0" :kibot "XAV" :name "CONTINUOUS E-MINI S&P 500 HEALTH CARE SECTOR CONTRACT" :category :future}
{:symbol "XAK0" :kibot "XAK" :name "CONTINUOUS E-MINI S&P 500 TECHNOLOGY SECTOR CONTRACT" :category :future}
{:symbol "XAP0" :kibot "XAP" :name "CONTINUOUS E-MINI S&P 500 CONSUMER STAPLES CONTRACT" :category :future}
{:symbol "XAY0" :kibot "XAY" :name "CONTINUOUS E-MINI S&P 500 CONSUMER DISCRETIONARY CONTRACT" :category :future}
{:symbol "XAI0" :kibot "XAI" :name "CONTINUOUS E-MINI S&P 500 INDUSTRIAL SECTOR CONTRACT" :category :future}
{:symbol "XAB0" :kibot "XAB" :name "CONTINUOUS E-MINI S&P 500 MATERIALS SECTOR CONTRACT" :category :future}
;
]

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns ta.data.alphavantage
(ns ta.data.api.alphavantage
(:require
[taoensso.timbre :refer [info warn error]]
[clj-http.client :as client]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns ta.data.bybit
(ns ta.data.api.bybit
(:require
[taoensso.timbre :refer [info]]
[clj-http.client :as http]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns ta.data.fred
(ns ta.data.api.fred
(:require
[clj-http.client :as client]
[cheshire.core] ; JSON Encoding
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
(ns ta.data.kibot
(ns ta.data.api.kibot
(:require
[clojure.string :as str]
[clojure.set]
[taoensso.timbre :refer [info warn error]]
[charred.api :as charred]
[clojure.edn :as edn]
[clj-http.client :as http]
[cheshire.core :as cheshire] ; JSON Encoding
[throttler.core]
[ta.helper.date :refer [parse-date]]
[ta.data.helper :refer [str->float]]))
[throttler.core]))


;; ApiKey Management
Expand Down Expand Up @@ -73,38 +70,41 @@
opts)
)))

(history {:symbol "AAPL"
:interval "daily"
:period 10
})


(history {:symbol "SIL" ; SIL - ETF
:interval "daily"
:period 1
:type "ETF" ; Can be stocks, ETFs forex, futures.
:timezone "UTC"
:splitadjusted 1
})

(comment

(history {:symbol "AAPL"
:interval "daily"
:period 10})

; futures
; http://www.kibot.com/historical_data/Futures_Historical_Tick_with_Bid_Ask_Data.aspx

(history {:symbol "SIL" ; SIL - FUTURE
:interval "daily"
:period 1
:type "futures" ; Can be stocks, ETFs forex, futures.
:timezone "UTC"
:splitadjusted 1})
(history {:symbol "SIL" ; SIL - ETF
:interval "daily"
:period 1
:type "ETF" ; Can be stocks, ETFs forex, futures.
:timezone "UTC"
:splitadjusted 1})

; futures
; http://www.kibot.com/historical_data/Futures_Historical_Tick_with_Bid_Ask_Data.aspx

(history {:symbol "SIL" ; SIL - FUTURE
:interval "daily"
:period 1
:type "futures" ; Can be stocks, ETFs forex, futures.
:timezone "UTC"
:splitadjusted 1})


(comment
(-> (slurp "../resources/symbollist/futures-kibot.edn")
(edn/read-string)
count)
;; => 83




;
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns ta.data.quandl
(ns ta.data.api.quandl
(:require
[clojure.string :as str]
[clojure.set]
Expand Down Expand Up @@ -58,7 +58,7 @@
(let [data (->> (load-cfutures-csv "../resources/cfutures.csv")
(map convert-instrument-spec)
(into []))]
(spit "../resources/symbollist/cfutures.edn" data)))
(spit "../resources/symbollist/futures-quandl.edn" data)))

(comment
(write-symbollist)
Expand Down Expand Up @@ -154,7 +154,7 @@
(def quandl-symbol-dict (atom {}))

(defn load-db []
(->> (slurp "../resources/symbollist/cfutures.edn")
(->> (slurp "../resources/symbollist/futures-quandl.edn")
(edn/read-string)
(map (fn [row]
[(:symbol row) (:Quandl-Code row)]))
Expand Down
Loading

0 comments on commit 4bfb5aa

Please sign in to comment.