Compare commits

..

No commits in common. "e8e574325e82aef38ad156dd1a7f88cb60032d17" and "f689686dc550d8e957e97ddadfe34e3b9792837a" have entirely different histories.

8 changed files with 88 additions and 90 deletions

View file

@ -1,9 +1,34 @@
@import "./theme.scss"; @import "./theme.scss";
@import "./bar/style.scss"; @import "./bar.scss";
@import "./timer/style.scss"; @import "./timer.scss";
@import "./freqtrade/style.scss";
* { * {
all: unset; all: unset;
font-family: "FiraCode Nerd Font"; font-family: "FiraCode Nerd Font";
} }
.trades-box {
margin: 12px;
padding: 8px;
background-color: #121212;
border-radius: 8px;
}
.profit {
background-color: #121212;
border: solid 4px;
border-color: #12bb7b;
border-radius: 5px;
padding: 3px;
margin-left: 8px;
&.loss {
border-color: red;
}
.arrow {
margin-left: 6px;
font-size: 18px;
}
}

View file

@ -1,5 +1,62 @@
(include "./bar/widget.yuck") (include "./bar.yuck")
(include "./timer/widget.yuck") (include "./timer.yuck")
(include "./freqtrade/widget.yuck")
(defpoll bots
:initial `[]`
:interval "3s"
`curl http://localhost:42667/list`
)
(defpoll absolute_profit
:interval "1s"
:initial 0
`echo $((RANDOM % 11))`
)
(defwidget profit-box [percent price]
(box :class {price >= 0 ? "profit" : "profit loss"} :space-evenly false
(label :text {price >= 0 ? "▲" : "▼"} :class "arrow" :halign "start")
(label :text "${round(percent, 2)}% (${round(price, 2)})" :class "price" :justify "center" :hexpand true)
)
)
(defwidget trades-box []
(box :orientation "v" :class "trades-box"
(box :orientation "h" :style "margin: 2px; font-weight: bold"
(label :text "Freqtrade" :style "font-family: Arial; font-size: 24px")
(label :text "Open profit")
(label :text "Closed profit")
)
(for bot in bots
(box :orientation "h" :style "margin: 2px"
(label :text "${bot.name}" :halign "start" :style "font-weight: bold; margin-right: 8px")
(profit-box :percent {bot.open_profit_pct} :price {bot.open_profit})
(profit-box :percent {bot.closed_profit_pct} :price {bot.closed_profit})
)
)
)
)
(defwidget profits-graph []
(box :class "trades-box"
(graph
:value {arraylength(bots) > 1 ? -bots[2].open_profit_pct * 2.0 : 0}
:time-range "40m"
:thickness 2
:line-style "round"
:dynamic true
)
)
)
(defwindow freqtrade
:monitor 0
:stacking "bg"
:geometry (geometry :x "0%"
:anchor "top right"
)
(box :orientation "v"
(trades-box)
(profits-graph)
)
)

View file

@ -1,25 +0,0 @@
.trades-box {
margin: 12px;
padding: 8px;
background-color: #121212;
border-radius: 8px;
}
.profit {
background-color: #121212;
border: solid 4px;
border-color: #12bb7b;
border-radius: 5px;
padding: 3px;
margin-left: 8px;
&.loss {
border-color: red;
}
.arrow {
margin-left: 6px;
font-size: 18px;
}
}

View file

@ -1,59 +0,0 @@
(defpoll bots
:initial `[]`
:interval "3s"
`curl http://localhost:42667/list`
)
(defpoll absolute_profit
:interval "1s"
:initial 0
`echo $((RANDOM % 11))`
)
(defwidget profit-box [percent price]
(box :class {price >= 0 ? "profit" : "profit loss"} :space-evenly false
(label :text {price >= 0 ? "▲" : "▼"} :class "arrow" :halign "start")
(label :text "${round(percent, 2)}% (${round(price, 2)})" :class "price" :justify "center" :hexpand true)
)
)
(defwidget trades-box []
(box :orientation "v" :class "trades-box"
(box :orientation "h" :style "margin: 2px; font-weight: bold"
(label :text "Freqtrade" :style "font-family: Arial; font-size: 24px")
(label :text "Open profit")
(label :text "Closed profit")
)
(for bot in bots
(box :orientation "h" :style "margin: 2px"
(label :text "${bot.name}" :halign "start" :style "font-weight: bold; margin-right: 8px")
(profit-box :percent {bot.open_profit_pct} :price {bot.open_profit})
(profit-box :percent {bot.closed_profit_pct} :price {bot.closed_profit})
)
)
)
)
(defwidget profits-graph []
(box :class "trades-box"
(graph
:value {arraylength(bots) > 1 ? -bots[2].open_profit_pct * 2.0 : 0}
:time-range "40m"
:thickness 2
:line-style "round"
:dynamic true
)
)
)
(defwindow freqtrade
:monitor 0
:stacking "bg"
:geometry (geometry :x "0%"
:anchor "top right"
)
(box :orientation "v"
(trades-box)
(profits-graph)
)
)