Skip to content

Commit

Permalink
moonphase revivie
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Sep 1, 2023
1 parent 3fd1894 commit 6183a15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/demo/src/demo/algo/moon.clj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
)

(defn moon-phase-shapes [user-options epoch-start epoch-end]
; todo: change api, so that it will add the ds also.
(shapes/algo-col->shapes
"moon"
user-options epoch-start epoch-end
Expand All @@ -79,7 +80,7 @@
:title "moon-phase-fullmoon" ; title should show up in pane settings
}}
{:volume {:type "line" :plottype (plot-type :columns)}}]
:shapes moon-phase-shapes ; fixed-shapes
; :shapes moon-phase-shapes ; fixed-shapes
:options {:symbol "SPY"
:frequency "D"}})

13 changes: 5 additions & 8 deletions lib/tradingview/src/ta/tradingview/goldly/algo/interaction.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,18 @@

(defn get-shapes-for-window [algo-ctx tv epoch-start epoch-end]
(println "get-shapes-for-window .. " epoch-start " - " epoch-end)
(if algo-ctx
(let [{:keys [algo opts]} (c/get-algo-input algo-ctx)
{:keys [symbol frequency]} opts
_ (println "get-algo-shapes algo: " algo "symbol: " symbol)
rp (clj 'ta.algo.manager/algo-shapes algo opts epoch-start epoch-end)]
(let [{:keys [algo opts]} (c/get-algo-input algo-ctx)
{:keys [symbol frequency]} opts
_ (println "get-algo-shapes algo: " algo "symbol: " symbol)
rp (clj 'ta.algo.manager/algo-shapes algo opts epoch-start epoch-end)]
(-> rp
(p/then (fn [shapes]
(println "get-algo-shapes :received " (count shapes) " shapes")
(add-shapes tv shapes)
nil))
(p/catch (fn [r]
(println "get-algo-shapes exception: " r)
nil))))
(println "error: algo-ctx is nill!")
))
nil)))))

(defn get-shapes-visible-window [algo-ctx tv]
(println "get-shapes-visible window ..")
Expand Down

0 comments on commit 6183a15

Please sign in to comment.