Skip to content

Commit

Permalink
dep bump goldly page-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Sep 18, 2023
1 parent 861df9c commit 38751e9
Show file tree
Hide file tree
Showing 66 changed files with 167 additions and 207 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 6 additions & 5 deletions app/demo/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
techascent/tech.viz {:mvn/version "6.00-beta-16-2"}
; com.clojure-goes-fast/clj-memory-meter {:mvn/version "0.1.0"}
com.taoensso/timbre {:mvn/version "6.2.2"} ; clj/cljs logging
org.pinkgorilla/reval {:mvn/version "0.5.137"}
org.pinkgorilla/reval {:mvn/version "0.5.139"}
; ta
ta/trateg {:local/root "../../lib/trateg" :deps/manifest :deps}
ta/data {:local/root "../../lib/data" :deps/manifest :deps}
ta/tradingview {:local/root "../../lib/tradingview" :deps/manifest :deps}
ta/indicator {:local/root "../../lib/indicator" :deps/manifest :deps}
ta/astro {:local/root "../../lib/astro" :deps/manifest :deps}
ta/gann {:local/root "../../lib/gann" :deps/manifest :deps}
joseph/joseph {:local/root "../../lib/joseph" :deps/manifest :deps}
; apps
ta/astro {:local/root "../../app/astro" :deps/manifest :deps}
ta/gann {:local/root "../../app/gann" :deps/manifest :deps}
joseph/joseph {:local/root "../../app/joseph" :deps/manifest :deps}

;com.clojure-goes-fast/clj-memory-meter {:mvn/version "0.1.0"}
;;
Expand All @@ -41,7 +42,7 @@
}

:docs ; RUN SERVICES (keep running)
{:extra-deps {org.pinkgorilla/goldly-docs {:mvn/version "0.4.616"}
{:extra-deps {org.pinkgorilla/goldly-docs {:mvn/version "0.4.618"}
com.fzakaria/slf4j-timbre {:mvn/version "0.4.0"}}
:extra-paths ["target/webly" ; to include the sci-bindings info
"node_modules"
Expand Down
42 changes: 17 additions & 25 deletions app/demo/src/demo/goldly/page/main.cljs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
(ns demo.goldly.page.main
(:require
[reagent.core :as r]
[goldly.page :as page]
[demo.goldly.lib.ui :refer [link-dispatch link-href]]))
[ta.viz.lib.ui :refer [link-dispatch link-href]]))

; main page

Expand All @@ -12,14 +10,14 @@
; trateg web ui
[:div.bg-blue-300.m-5
[:h1.text-xl.text-red-600 "trateg "]

; tradingview
[:p.text-blue.text-xl "tradingview"]
[link-dispatch [:bidi/goto :tradingview/algo] "tradingview-algo"]
[link-dispatch [:bidi/goto :tradingview/udf] "tradingview-udf"]

[link-dispatch [:bidi/goto 'ta.tradingview.goldly.page.tradingview-algo/tvalgo-page] "tradingview-algo"]
[link-dispatch [:bidi/goto 'ta.tradingview.goldly.page.tradingview-udf/tradingview-page] "tradingview-udf"]
; backtest
[:p.text-blue.text-xl "backtest"]
[link-href "/algo/backtest" "backtester"]

; warehouse
[:p.text-blue.text-xl "warehouse"]
[link-href "/warehouse" "warehouse"]
[link-href "/series" "series"]]
Expand All @@ -28,33 +26,27 @@
[:div.bg-blue-300.m-5
[:h1.text-xl.text-red-600 "joseph"]
[link-href "/joseph" "tradingview"]
[link-dispatch [:bidi/goto :joseph/nav] "nav"]
[link-dispatch [:bidi/goto :joseph/live] "live"]]
[link-dispatch [:bidi/goto 'joseph.page.nav/page-joseph-nav] "nav"]
[link-dispatch [:bidi/goto 'joseph.page.live/page-joseph-live] "live"]
[link-dispatch [:bidi/goto 'joseph.page.live2/page-live-trading] "live v2"]]

[:div.bg-blue-300.m-5
[:h1.text-xl.text-red-600 "gann tools"]
[link-href "/gann" "gann chart"]

]
[link-href "/gann" "gann chart"]]

; test
[:div.bg-blue-300.m-5
[:p.text-blue.text-xl "test"]
[link-dispatch [:bidi/goto :test/test] "test-page"]
[link-dispatch [:bidi/goto :test/layout1] "layout-1"]
[link-dispatch [:bidi/goto :test/layout2] "layout-2"]

]
[link-dispatch [:bidi/goto 'demo.goldly.page.test.test/test-page] "test-page"]
[link-dispatch [:bidi/goto 'demo.goldly.page.test.layout/page-layout-1] "layout-1"]
[link-dispatch [:bidi/goto 'demo.goldly.page.test.layout/page-layout-2] "layout-2"]]
; goldly developer tools
[:div.bg-blue-300.m-5

[:p.text-blue.text-xl "goldly developer tools"]
[link-dispatch [:bidi/goto :viewer :query-params {}] "notebook viewer"]
[link-dispatch [:bidi/goto :scratchpad] "scratchpad"]
[link-dispatch [:bidi/goto :environment] "environment"]
[link-dispatch [:bidi/goto :devtools] "devtools help"]]
[link-dispatch [:bidi/goto 'reval.goldly.page.notebook-viewer/viewer-page :query-params {}] "notebook viewer"]
[link-dispatch [:bidi/goto 'scratchpad.page.scratchpad/scratchpad] "scratchpad"]
[link-dispatch [:bidi/goto 'goldly.devtools.page.runtime/runtime-page] "environment"]
[link-dispatch [:bidi/goto 'goldly.devtools.page.help/devtools-page] "devtools help"]]

;
])

(page/add main-page :user/main)
6 changes: 1 addition & 5 deletions app/demo/src/demo/goldly/page/test/layout.cljs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(ns demo.goldly.page.test.layout
(:require
[goldly.page :as page]
[site :refer [ipsum]]
[demo.goldly.lib.layout :as layout]))
[ta.viz.lib.layout :as layout]))

(defn page-layout-1 [_route]
(layout/left-right-top {:top "top"
Expand All @@ -14,6 +13,3 @@
:left [:div.bg-blue-500.w-full.h-full.overflow-scroll (ipsum 5)]
:right [:div.bg-green-500.w-full.h-full (ipsum 100)]}))


(page/add page-layout-1 :test/layout1)
(page/add page-layout-2 :test/layout2)
10 changes: 2 additions & 8 deletions app/demo/src/demo/goldly/page/test/test.cljs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(ns demo.goldly.page.test.test
(:require
[reagent.core :as r]
[goldly.page :as page]
[demo.goldly.view.tsymbol :refer [symbol-picker]]
[ta.viz.view.tsymbol :refer [symbol-picker]]
[joseph.upload :refer [upload-file-ui]]
))

Expand Down Expand Up @@ -33,9 +32,4 @@
[:div.w-64
[symbol-picker symbol-atom [:symbol]]
[upload-file-ui]
]])




(page/add test-page :test/test)
]])
8 changes: 4 additions & 4 deletions app/demo/src/ta-config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
; runtime
:autoload-cljs-dir ["demo/goldly/page"
"demo/goldly/page/test"]
:routes {:app {"" :user/main
"test/" {"test" :test/test
"layout1" :test/layout1
"layout2" :test/layout2
:routes {:app {"" demo.goldly.page.main/main-page
"test/" {"test" demo.goldly.page.test.test/test-page
"layout1" demo.goldly.page.test.layout/page-layout-1
"layout2" demo.goldly.page.test.layout/page-layout-2
}}
:api {"arrow" :dataset/arrow}}}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
ta.gann.svg-plot/gann-svg-web
ta.gann.svg-plot/get-boxes]}

:cljs-routes {"gann" :gann}

:cljs-routes {"gann" ta.gann.page.gann/gann-page}
:sci-cljs-ns [ta.gann.page.gann]

}

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
(ns demo.goldly.page.gann
(ns ta.gann.page.gann
(:require
[reagent.core :as r]
[goldly.service.core :refer [run-a run-cb]]
[goldly.page :as page]
[ui.aggrid :refer [aggrid]]
[ui.rnd :refer [rnd]]
[input]
[demo.goldly.lib.ui :refer [link-href to-fixed rnd]] ; todo: move rnd + to-fixed out of user
[demo.goldly.view.tsymbol :refer [symbol-picker]]))
[goldly.service.core :refer [run-a run-cb]]
[goldly.js :refer [to-fixed]]
[ta.viz.lib.ui :refer [link-href]]
[ta.viz.view.tsymbol :refer [symbol-picker]]))

(defn round-number-digits
[digits number] ; digits is first parameter, so it can easily be applied (data last)
Expand Down Expand Up @@ -73,7 +74,7 @@
(run-a *state [:data]
'ta.gann.svg-plot/gann-svg-web
p-with-size-rootbox)
(run-a *state [:boxes] :gann/boxes p-with-size-rootbox)))
(run-a *state [:boxes] 'ta.gann.svg-plot/get-boxes p-with-size-rootbox)))

(defn save-rootbox []
(let [root-box (:root @*state)]
Expand Down Expand Up @@ -190,4 +191,3 @@
;[:div.bg-gray-500.mt-12 "params:" (pr-str (:params @*state))]
]))

(page/add gann-page :gann)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions app/joseph/resources/ext/joseph.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{:name "joseph"
; runtime
:api-routes {"joseph/" {:post {"upload" joseph.upload/wrapped-save-file}}}
:clj-services {:name "joseph"
:permission #{:dev}
:symbols [joseph.nav/calc-nav-browser
joseph.trades/load-trades
joseph.realtime/realtime-snapshot
joseph.realtime/realtime-snapshot-stocks
joseph.realtime/daily-snapshot-futures]}

:cljs-routes {"joseph" {"" joseph.page.tradingview/tradingview-trades-page
"/nav" joseph.page.nav/page-joseph-nav
"/live" joseph.page.live/page-joseph-live
"/live2" joseph.page.live2/page-live-trading}}

:sci-cljs-ns [; lib
joseph.lib.live-pl
joseph.lib.loader
joseph.lib.quote-table
joseph.lib.select
joseph.lib.trade-filter
joseph.lib.viz-filter
; root
joseph.upload
; page
joseph.page.live
joseph.page.live2
joseph.page.nav
joseph.page.tradingview]
}

Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
(ns joseph.lib.live-pl
(:require
[goldly.js :refer [to-fixed]]
))

[goldly.js :refer [to-fixed]]))

(defn round-number-digits
[digits number] ; digits is first parameter, so it can easily be applied (data last)
(if (nil? number) "" (to-fixed number digits)))


(defn current-pl [{:keys [qty side entry-price]} current-price]
(let [change (- current-price entry-price)
qty2 (if (= side :long)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
[reagent.core :as r]
[promesa.core :as p]
[goldly.service.core :as service]
[ui.webly :refer [notify]]
))
[ui.webly :refer [notify]]))

(defn clj [init-value fun & args]
(let [a (r/atom init-value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
(defn quote-table [quotes]
[aggrid {:box :fl
:data quotes
:columns [{:field :symbol}
{:field :date}
{:field :time}
:columns [{:field :symbol :width 50}
{:field :date :width 50}
{:field :time :width 50}
;{:field :timezone}
{:field :open}
{:field :high}
{:field :low}
{:field :close}
{:field :volume}
{:field :changepercent}
{:field :open :width 50}
{:field :high :width 50}
{:field :low :width 50}
{:field :close :width 50}
{:field :volume :width 50}
{:field :changepercent :width 50}
;{:field :lastprice}
;{:field :lastvolume}
]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
(ns joseph.lib.trade-filter
(:require
[clojure.string :as str]

))
[clojure.string :as str]))


(defn live-trade? [{:keys [exit-date]}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
(:require
[clojure.string :as str]))



(def all "*")


(defn filter-viz-eq [key value list]
(let [disabled? (or (nil? value)
(str/blank? value)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
(:require
[reagent.core :as r]
[clojure.string :as str]
[goldly.page :as page]

; ui
[demo.goldly.lib.layout :as layout]
[joseph.lib.select :refer [select-string]]
; trateg
[ta.viz.lib.layout :as layout]
[ta.viz.trades-table :refer [trades-table-live]]
; load data
[demo.goldly.lib.loader :refer [clj->p]]
;data helper
[ta.viz.lib.loader :refer [clj->p]]
; joseph
[joseph.lib.select :refer [select-string]]
[joseph.lib.live-pl :refer [trades-with-pl]]
[joseph.lib.trade-filter :refer [filter-trades]]
[joseph.lib.quote-table :refer [quote-table]]
))
[joseph.lib.quote-table :refer [quote-table]]))

(defn accounts [trades]
(->> trades
Expand Down Expand Up @@ -70,7 +66,4 @@
:loading [:p "loading"]
:error [:p "error!"]
:data [live-trade-ui (:data @trades-ra)]
[:p "unknown: status:" (pr-str @trades-ra)]))))


(page/add page-joseph-live :joseph/live)
[:p "unknown: status:" (pr-str @trades-ra)]))))
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
(:require
[reagent.core :as r]
[reagent.ratom :refer [make-reaction]]
[goldly.page :as page]
; trateg
; pure ui-functions
[demo.goldly.lib.layout :as layout]
[ta.viz.lib.layout :as layout]
[ta.viz.trades-table :refer [trades-table-live]]
; joseph - pure ui
[joseph.lib.quote-table :refer [quote-table]]
[joseph.lib.select :refer [select-string]]
; data helper
; joseph - data helper
[joseph.lib.loader :refer [clj]]
[joseph.lib.viz-filter :as vf]
[joseph.lib.trade-filter :refer [filter-trades]]
Expand Down Expand Up @@ -49,7 +48,4 @@


(defn page-live-trading [_route]
[live-dashboard])


(page/add page-live-trading :joseph/live2)
[live-dashboard])
Loading

0 comments on commit 38751e9

Please sign in to comment.