From d94804b3c286c8a0b9bda53ae9b0f1b4297fb9fd Mon Sep 17 00:00:00 2001 From: awb99 Date: Wed, 10 Jul 2024 10:55:31 -0500 Subject: [PATCH] signal longshort --- lib/trade/src/ta/trade/signal.clj | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/trade/src/ta/trade/signal.clj b/lib/trade/src/ta/trade/signal.clj index bdb8573a..5a1cb4bb 100644 --- a/lib/trade/src/ta/trade/signal.clj +++ b/lib/trade/src/ta/trade/signal.clj @@ -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))))) @@ -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