Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Jul 11, 2024
1 parent 8d7ab45 commit 5368fd5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/indicator/src/ta/indicator.clj
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@
(into [] (chebyshev-tfn g) v))))

(defn macd
"MACD Indicator"
([col] (macd {:n 12 :m 26} col))
([{:keys [n m]} col]
(let [ema-short (ema n col)
Expand Down
10 changes: 9 additions & 1 deletion lib/indicator/src/ta/indicator/band.clj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@
(dfn/* k))]
(add-bands mid delta delta pre mid? bar-ds)))

(defn add-atr-band [{:keys [atr-n atr-m pre mid?]
(defn add-atr-band
"adds atr band indicator to dataset
atr-n is the number of bars for atr calc
atr-m is the multiplyer
Band | formula
Middle | prior close
Upper | middle + (n-day atr) * atr-m
Lower | middle + (n-day atr) * atr-m "
[{:keys [atr-n atr-m pre mid?]
:or {pre "atr-band"
mid? true}} bar-ds]
(assert atr-n "atr-band needs :atr-n option")
Expand Down

0 comments on commit 5368fd5

Please sign in to comment.