Skip to content

Commit

Permalink
services in extension.edn
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Sep 9, 2023
1 parent e17dd05 commit c10617e
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 60 deletions.
2 changes: 1 addition & 1 deletion app/demo/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}

:docs ; RUN SERVICES (keep running)
{:extra-deps {org.pinkgorilla/goldly-docs {:mvn/version "0.4.613"}
{:extra-deps {org.pinkgorilla/goldly-docs {:mvn/version "0.4.614"}
com.fzakaria/slf4j-timbre {:mvn/version "0.4.0"}}
:extra-paths ["target/webly" ; to include the sci-bindings info
"node_modules"
Expand Down
4 changes: 1 addition & 3 deletions app/demo/src/demo/algo/joseph.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
[tablecloth.api :as tc]
[tick.core :as t]
[ta.helper.date :refer [parse-date epoch-second->datetime ->epoch-second ]]
[joseph.trades :refer [load-trades]]
[ta.algo.manager :refer [add-algo]]
[ta.tradingview.chart.plot :refer [plot-type linestyle]]
[ta.tradingview.chart.shape :as shapes2]
[ta.tradingview.chart.color :refer [color]]
[joseph.trades :refer [load-trades]]
))



(defn trade-filter-symbol [symbol trades]
(filter #(= (:symbol %) symbol) trades))

Expand Down
11 changes: 10 additions & 1 deletion app/demo/src/demo/goldly/view/vega_list.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[ui.vega.plot :refer [list-plot]]))

(defn vega-list-plot [data]
[:div
^:R
[:div
[:h1 "vega-list-plot"]
[:div.flex.flex-row.content-between
[:div.flex.flex-col.justify-start
Expand All @@ -15,3 +16,11 @@
:plot-range [:all :all]
:opacity 0.5})]]])


(comment

(vega-list-plot [1 2 3 2 1 2 3 4 5 3 2 1 2 5 3])

;
)

4 changes: 0 additions & 4 deletions app/demo/src/services-docs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@
:middleware cider.nrepl.middleware/cider-middleware
:handler cider.nrepl/cider-nrepl-handler)
:stop (.close this)}

:clj-services {:start (goldly.service.expose/start-services
(:clj-services (deref (clip/ref :config))))
:stop (goldly.service.expose/stop-services this)}

:scheduler {:start (ta.data.scheduler/start!
(clip/ref :timbre))
Expand Down
35 changes: 2 additions & 33 deletions app/demo/src/ta-config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
:goldly {:lazy true
:src-dir "src"
; runtime
:autoload-cljs-dir ["ta/tradingview/goldly/page"
"demo/goldly/page"]
:autoload-cljs-dir ["demo/goldly/page"]
:routes {:app {"" :user/main
"test" :user/test
;warehouse
Expand Down Expand Up @@ -48,7 +47,7 @@
:studies [:clj "notebook/studies/"]
:datascience [:clj "notebook/datascience/"]
:playground [:clj "notebook/playground/"]
:demo [:clj "demo/notebook/"]
;:demo [:clj "demo/notebook/"]
:test [:cljs "demo/goldly/view/"]}}

:ta {:warehouse {:list "../resources/symbollist/"
Expand All @@ -75,36 +74,6 @@
:template-path "../resources/tradingview-templates/"
:marks-path "../../data/"}}

:clj-services {:name "trateg services"
:symbols [; warehouse
ta.warehouse.symbollist/get-lists
ta.warehouse.symbollist/load-list
ta.warehouse.overview/overview-map
; data
ta.data.load/load-series
; algo
ta.algo.manager/algo-names
ta.algo.manager/algo-info
ta.algo.manager/tradingview-algo-chart-specs
ta.algo.manager/algo-run-window-browser
ta.algo.manager/algo-run-browser
ta.algo.manager/algo-marks
ta.algo.manager/algo-shapes
; tradingview api (via websocket)
ta.tradingview.handler-datasource/get-server-config
ta.tradingview.handler-datasource/symbol-info
ta.tradingview.handler-datasource/symbol-search
ta.tradingview.handler-datasource/server-time
; gann
ta.gann.db/load-gann
ta.gann.db/save-gann
ta.gann.svg-plot/gann-svg-web
ta.gann.svg-plot/get-boxes
; joseph
demo.algo.joseph/load-trades
; testing
ta.helper.date/now-datetime]
:permission #{}}

:demo {:gann-data-file "../resources/gann.edn"}
;
Expand Down
4 changes: 3 additions & 1 deletion lib/gann/deps.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{:paths ["src"]
{:paths ["src"
"resources" ; extension data
]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
io.github.adam-james-v/svg-clj {:mvn/version "0.0.11"}
cljplot/cljplot {:mvn/version "0.0.3"}
Expand Down
12 changes: 12 additions & 0 deletions lib/gann/resources/ext/gann.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{:name "gann"
; runtime
:clj-services {:name "gann"
:permission #{:dev}
:symbols [; gann
ta.gann.db/load-gann
ta.gann.db/save-gann
ta.gann.svg-plot/gann-svg-web
ta.gann.svg-plot/get-boxes]}

}

12 changes: 8 additions & 4 deletions lib/joseph/resources/ext/joseph.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{:name "joseph"
; runtime
:api-routes {"joseph/" {:post {"upload" joseph.upload/wrapped-save-file}

}
}}
:api-routes {"joseph/" {:post {"upload" joseph.upload/wrapped-save-file}}}
:clj-services {:name "joseph"
:permission #{:dev}
:symbols [joseph.nav/calc-nav
joseph.trades/load-trades]}

:autoload-cljs-dir ["joseph/page"]
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns demo.goldly.page.joseph
(ns joseph.page.tradingview
(:require
[reagent.core :as r]
[cljc.java-time.local-date-time :as ldt]
Expand All @@ -14,7 +14,6 @@
[ta.tradingview.goldly.algo.context :as c]
[ta.tradingview.goldly.algo.tradingview :refer [tradingview-algo]]
[ta.tradingview.goldly.page.tradingview-algo :refer []]

[ta.tradingview.goldly.interact :refer [tv-widget-atom]]
[ta.tradingview.goldly.interact2 :refer [goto-date!]]
))
Expand Down Expand Up @@ -128,7 +127,7 @@
(defn trades-view []
(let [trades (r/atom {})]
(fn []
(clj->a trades 'demo.algo.joseph/load-trades)
(clj->a trades 'joseph.trades/load-trades)
[:div.w-full.h-full
;[:h1.text-bold.bg-green-500 "Bars for symbol: " s " f: " f]
(case (:status @trades)
Expand Down
2 changes: 1 addition & 1 deletion lib/tradingview/deps.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{:paths ["src"
"resources" ; tradingview javascript library
"resources" ; tradingview javascript library + extension data
]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
tick/tick {:mvn/version "0.6.2"}
Expand Down
9 changes: 9 additions & 0 deletions lib/tradingview/resources/ext/tradingview.edn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
; :put ta.tradingview.handler-storage/
; :delete ta.tradingview.handler-storage/
}}}}
:clj-services {:name "tradingview"
:permission #{}
:symbols [; tradingview api (via websocket)
ta.tradingview.handler-datasource/get-server-config
ta.tradingview.handler-datasource/symbol-info
ta.tradingview.handler-datasource/symbol-search
ta.tradingview.handler-datasource/server-time]}

:autoload-cljs-dir ["ta/tradingview/goldly/page"]


}
4 changes: 3 additions & 1 deletion lib/trateg/deps.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{:paths ["src"]
{:paths ["src"
"resources" ; extension data
]
:deps
{org.clojure/clojure {:mvn/version "1.11.1"}
org.clojure/core.async {:mvn/version "1.3.618"}
Expand Down
22 changes: 22 additions & 0 deletions lib/trateg/resources/ext/trateg.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{; runtime
:clj-services {:name "trateg services"
:permission #{}
:symbols [; warehouse
ta.warehouse.symbollist/get-lists
ta.warehouse.symbollist/load-list
ta.warehouse.overview/overview-map
; data
ta.data.load/load-series
; algo
ta.algo.manager/algo-names
ta.algo.manager/algo-info
ta.algo.manager/tradingview-algo-chart-specs
ta.algo.manager/algo-run-window-browser
ta.algo.manager/algo-run-browser
ta.algo.manager/algo-marks
ta.algo.manager/algo-shapes
; testing
ta.helper.date/now-datetime]}


}
10 changes: 2 additions & 8 deletions lib/trateg/src/ta/multi/nav_trades.clj
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,7 @@
(portfolio (take 400 trades))
(portfolio trades)


;count
(portfolio-stats)
)



;
)

)

0 comments on commit c10617e

Please sign in to comment.