Skip to content

Commit

Permalink
signal longshort
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Jul 10, 2024
1 parent cb087b4 commit d94804b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/trade/src/ta/trade/signal.clj
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
(let [n (tc/row-count long-bool-signal-col)]
(dtype/make-reader
:keyword n
(let [s (long-bool-signal-col idx)]
(case s
(let [l (long-bool-signal-col idx)]
(case l
true :long
nil)))))

Expand All @@ -56,6 +56,17 @@
true :short
nil)))))

(defn signal-bool-long-short->keyword [long-bool-signal-col short-bool-signal-col]
(let [n (tc/row-count short-bool-signal-col)]
(dtype/make-reader
:keyword n
(let [s (short-bool-signal-col idx)
l (long-bool-signal-col idx)]
(cond
s :short
l :long
:else nil)))))

(comment

(def ds
Expand Down

0 comments on commit d94804b

Please sign in to comment.