Skip to content

Commit eb0f903

Browse files
committed
Sort stocks on dashboard by trading signal
1 parent 302d797 commit eb0f903

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

default/data/ui/views/stocks.xml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
<panel>
66
<title>Stocks Summary</title>
77
<table>
8-
<title>Sorted by bullishPercent, newsScore, articlesLastWeek, and change</title>
8+
<title>Sorted by signal, bullishPercent, newsScore, articlesLastWeek, and change</title>
99
<search>
1010
<query>| quote
1111
| spath
1212
| convert num(quote.c), num(quote.pc)
13-
| eval change = ('quote.c'/'quote.pc'-1)*100
14-
| table ticker change quote.c quote.pc technicalAnalysis.signal sentiment.buzz.articlesInLastWeek sentiment.buzz.weeklyAverage sentiment.companyNewsScore sentiment.sectorAverageNewsScore sentiment.buzz.buzz sentiment.sentiment.bullishPercent sentiment.sectorAverageBullishPercent
15-
| sort - sentiment.sentiment.bullishPercent sentiment.companyNewsScore sentiment.buzz.articlesInLastWeek change
13+
| eval change = ('quote.c'/'quote.pc'-1)*100, signalRating = case('technicalAnalysis.signal' = "strong buy", 5, 'technicalAnalysis.signal' = "buy", 4, 'technicalAnalysis.signal' = "neutral", 3, 'technicalAnalysis.signal' = "sell", 2, 'technicalAnalysis.signal' = "strong sell", 1, true(), 0)
14+
| table ticker change quote.c quote.pc signalRating technicalAnalysis.signal sentiment.buzz.articlesInLastWeek sentiment.buzz.weeklyAverage sentiment.companyNewsScore sentiment.sectorAverageNewsScore sentiment.buzz.buzz sentiment.sentiment.bullishPercent sentiment.sectorAverageBullishPercent
15+
| sort - signalRating sentiment.sentiment.bullishPercent sentiment.companyNewsScore sentiment.buzz.articlesInLastWeek +change
16+
| fields - signalRating
1617
| rename quote.c as close, quote.pc as prevClose, technicalAnalysis.signal as signal, sentiment.buzz.articlesInLastWeek as articlesLastWeek, sentiment.buzz.weeklyAverage as weeklyAverage, sentiment.companyNewsScore as newsScore, sentiment.sectorAverageNewsScore as sectorAvgNewsScore, sentiment.buzz.buzz as buzz, sentiment.sentiment.bullishPercent as bullishPercent, sentiment.sectorAverageBullishPercent as sectorAvgBullishPercent</query>
1718
<earliest>-24h@h</earliest>
1819
<latest>now</latest>
@@ -69,12 +70,16 @@
6970
<panel>
7071
<title>ETF Ratings</title>
7172
<table>
73+
<title>Sorted by signal and change</title>
7274
<search>
7375
<query>| quote QQQ TQQQ VGT VYM SPHD
7476
| spath
75-
| table ticker, quote.c, technicalAnalysis.signal
76-
| sort ticker
77-
| rename quote.c as close, technicalAnalysis.signal as signal</query>
77+
| convert num(quote.c), num(quote.pc)
78+
| eval change = ('quote.c'/'quote.pc'-1)*100, signalRating = case('technicalAnalysis.signal' = "strong buy", 5, 'technicalAnalysis.signal' = "buy", 4, 'technicalAnalysis.signal' = "neutral", 3, 'technicalAnalysis.signal' = "sell", 2, 'technicalAnalysis.signal' = "strong sell", 1, true(), 0)
79+
| table ticker change quote.c quote.pc signalRating technicalAnalysis.signal
80+
| sort - signalRating +change
81+
| fields - signalRating
82+
| rename quote.c as close, quote.pc as prevClose, technicalAnalysis.signal as signal</query>
7883
<earliest>-24h@h</earliest>
7984
<latest>now</latest>
8085
<sampleRatio>1</sampleRatio>
@@ -86,6 +91,13 @@
8691
<option name="rowNumbers">false</option>
8792
<option name="totalsRow">false</option>
8893
<option name="wrap">true</option>
94+
<format type="color" field="change">
95+
<colorPalette type="minMidMax" maxColor="#53A051" midColor="#FFFFFF" minColor="#DC4E41"></colorPalette>
96+
<scale type="minMidMax" maxValue="3.5" midValue="0" minValue="-3.5"></scale>
97+
</format>
98+
<format type="number" field="change">
99+
<option name="unit">%</option>
100+
</format>
89101
<drilldown>
90102
<set token="ticker">$click.value$</set>
91103
</drilldown>

0 commit comments

Comments
 (0)