From 5368fd5cc8e999e3b5d2015c838b1dfd4511742d Mon Sep 17 00:00:00 2001 From: awb99 Date: Wed, 10 Jul 2024 21:49:26 -0500 Subject: [PATCH] docstrings --- lib/indicator/src/ta/indicator.clj | 1 + lib/indicator/src/ta/indicator/band.clj | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/indicator/src/ta/indicator.clj b/lib/indicator/src/ta/indicator.clj index 6f70cf98..3eca6d6a 100644 --- a/lib/indicator/src/ta/indicator.clj +++ b/lib/indicator/src/ta/indicator.clj @@ -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) diff --git a/lib/indicator/src/ta/indicator/band.clj b/lib/indicator/src/ta/indicator/band.clj index 76d60d5f..3de135fd 100644 --- a/lib/indicator/src/ta/indicator/band.clj +++ b/lib/indicator/src/ta/indicator/band.clj @@ -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")