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 3, 2023
1 parent
97488af
commit c074b7f
Showing
2 changed files
with
39 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
(ns ta.data.api-ds.bybit | ||
(:require | ||
[tick.core :as tick] ; tick uses cljc.java-time | ||
[tech.v3.dataset :as tds] | ||
[ta.data.api.bybit :as bybit])) | ||
|
||
|
||
(defn bybit-result->dataset [response] | ||
(-> response | ||
(tds/->dataset))) | ||
|
||
|
||
(defn symbol->provider [symbol] | ||
; {:keys [category] :as instrument} (db/instrument-details symbol) | ||
symbol) | ||
|
||
(def start-date-bybit (tick/date-time "2018-11-01T00:00:00")) | ||
|
||
(defn get-series [symbol interval _range _opts] | ||
(let [symbol (symbol->provider symbol)] | ||
(-> (bybit/get-history {:symbol symbol | ||
:start start-date-bybit | ||
:interval interval}) | ||
(bybit-result->dataset)))) | ||
|
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