Skip to content

Commit

Permalink
Merge branch 'master' of github.com:clojure-quant/trateg
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Oct 15, 2024
2 parents f6aaabc + c135e70 commit e647885
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/calendar/src/ta/calendar/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
(defn calendar-seq->range [cal-seq]
(cal/calendar-seq->range cal-seq))

(defn get-bar-window [[calendar-kw interval-kw] bar-end-dt]
(cal/get-bar-window [calendar-kw interval-kw] bar-end-dt))

(defn get-bar-duration
[[calendar-kw interval-kw]]
(cal/get-bar-duration [calendar-kw interval-kw]))
22 changes: 21 additions & 1 deletion lib/calendar/src/ta/calendar/interval.clj
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,31 @@
:m4 (gen-intraday-step-fn 4 :minutes)
:m5 (gen-intraday-step-fn 5 :minutes)
:m6 (gen-intraday-step-fn 6 :minutes)
:m8 (gen-intraday-step-fn 8 :minutes)
:m9 (gen-intraday-step-fn 9 :minutes)
:m10 (gen-intraday-step-fn 10 :minutes)
:m12 (gen-intraday-step-fn 12 :minutes)
:m15 (gen-intraday-step-fn 15 :minutes)
:m16 (gen-intraday-step-fn 16 :minutes)
:m18 (gen-intraday-step-fn 18 :minutes)
:m20 (gen-intraday-step-fn 20 :minutes)
:m30 (gen-intraday-step-fn 30 :minutes)})
:m24 (gen-intraday-step-fn 24 :minutes)
:m30 (gen-intraday-step-fn 30 :minutes)
:m32 (gen-intraday-step-fn 32 :minutes)
:m36 (gen-intraday-step-fn 36 :minutes)
:m40 (gen-intraday-step-fn 40 :minutes)
:m48 (gen-intraday-step-fn 48 :minutes)

:m72 (gen-intraday-step-fn 72 :minutes)
:m80 (gen-intraday-step-fn 80 :minutes)
:m90 (gen-intraday-step-fn 90 :minutes)
:m96 (gen-intraday-step-fn 96 :minutes)
:m144 (gen-intraday-step-fn 144 :minutes)
:m160 (gen-intraday-step-fn 160 :minutes)
:m288 (gen-intraday-step-fn 288 :minutes)})

; all divider of 1440 (minutes of day)
;1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 30, 32, 36, 40, 48, 60, 72, 80, 90, 96, 120, 144, 160, 180, 240, 288, 360, 480, 720, 1440

(defn interval-exists? [interval-kw]
(contains? intervals interval-kw))
Expand Down

0 comments on commit e647885

Please sign in to comment.