You are not logged in.
Pages: 1
Hi,
Could members here advise if there is a panel app which shows stock quotes (symbol+quote+%change), for example in a ticker format or a table format?..
Thanks
Offline
Here is a first run at something that might fit the bill. It uses the xfce4-genmon-plugin and requires the package "jq" and that you install ticker.sh.
Then use this script in xfce4-genmon-plugin:
#!/bin/bash
# list of stocks to show in the tooltip
STOCKS="GME MSFT GOOG BTC-USD APPL FGEN ODT"
# the stock to show on the panel
SHOW="GME"
FIRST="$(env NO_COLOR=1 /home/toz/ticker.sh $SHOW)"
ALL="$(env NO_COLOR=1 /home/toz/ticker.sh $STOCKS)"
echo "<txt>$FIRST</txt><tool>$ALL</tool>"
exit 0
...make the script executable, change the path to the ticker.sh file on lines 9 & 10 to point to the location of your ticker.sh script, and change the "STOCKS" and "SHOW" variables to suit your needs.
In the genmon properties, disable the label and set the period to your refresh frequency.
Last edited by ToZ (2021-04-07 22:14:14)
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
I myself have not use for that, ToZ, but that's very cool.
MX-23 (based on Debian Stable) with our flagship Xfce 4.18.
Offline
Excellent!
This is another example that begs for a better way to schedule genmon's other than an interval.
Offline
Excellent!
This is another example that begs for a better way to schedule genmon's other than an interval.
What do you mean? In this case, the interval is the refresh time (refresh quote data). Isn't that what would be expected here?
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
What do you mean?
Minor traffic, but I'd like it timed and not every so often. Market closed, holidays and other periods to go quiet, starting at open, cease at close, maybe an after hours check, maybe every minute from 7:30 local to 7:45, similar last 15 minutes, etc...
Really, I'd like similar timing for weather, and the convoluted genmon I use for 8 channel dvb status and stream monitoring.
I've been pondering on this for awhile with no complete thought yet, but basically some timing mechanism in a cron like format. Maybe an interval entry of '0' zero could trigger reference to an external $(name)-genmon.cron where the schedule could be formatted. Even better would be events to trigger or modify timing, referenced in that same file.
Last edited by CwF (2021-04-08 17:08:17)
Offline
What if you separated the script and the timing from the actual display. For example, have something working in the background, based on cron timing frequencies, and send the output to a file. Then only use genmon to display the contents of the file? The genmon frequency would become kid of irrelevant, it would only refresh the display based on whats in the file and if that hasn't changed, the genmon content stays the same.
It's not exactly as you are thinking since the cycle will still fire at regular intervals. However, in the code, the cycle will still need to run regardless, even if to check the cron settings. At least that's the way it is now without a major re-write.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Yes, that's what I do for a few things.
Weather at a local AFB is updated hourly, so cron times the cache file, my genmon just parses the local file. So it's never down, just the timestamp for reference. The wttr version is often down, and not locally very accurate.
just dreaming!
Offline
A slightly better formatted version:
#!/bin/bash
# list of stocks to show in the tooltip
STOCKS="GME MSFT GOOG BTC-USD AAPL FGEN ODT CVNA TSLA ETSY QRTEA BIO WTM HUN VIRT"
# the stock to show on the panel - from list above starting at 0
PANEL=8
### No need to change anything below
UPDATE=$(date)
NUM_STOCKS=$(echo $STOCKS | awk '{for(i=0;i<=NF;i++); print i-1 }')
declare -A stock=() price=() change=() percent=()
{
c=0
while read -r STOCK PRICE CHANGE PERCENT; do
stock[$c]=$(printf %-8s $STOCK)
price[$c]=$(printf %10s $PRICE)
change[$c]=$(printf %10s $CHANGE)
percent[$c]=$PERCENT
((c=c+1))
done
} < <(env NO_COLOR=1 /home/toz/ticker.sh $STOCKS)
OUT=$(echo ${stock[$PANEL]}${price[$PANEL]}${change[$PANEL]} "${percent[$PANEL]}" | sed -e 's/ */ /g')
for (( c=0; c<$NUM_STOCKS; c++ ))
do
TOOL="$TOOL${stock[$c]}${price[$c]}${change[$c]}\t${percent[$c]}\n"
done
TOOL="$TOOL\n<small><i>Last Updated: $UPDATE</i></small>"
echo -e "<txt>$OUT</txt><tool><tt>$TOOL</tt></tool>"
exit 0
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Very nice work, clean colums
I did the file option from cron.
env NO_COLOR=1 ticker.sh 1 2 3' > ~/ticker.txt
...if no color tags
P1=$(cat ~/ticker.txt | grep 1 | cut -b 13-18)
to clip out share price of stock 1
a few lines for quantity
V3=$(echo "$P3 * 1200" | bc)
...then a sum for main
ACCT=$(echo "$P1 + $P2 + $P3" | bc)
echo "<txt>$ACCT</txt><tool>$ALL</tool>"
where 1 2 3 are some stocks in a taxable category.
btw, I had, HAD, GME since they paid dividends...
Oh, I figured the trailing asterisk is a after hours price.
Offline
That's interesting. You have the monetary value of your account in the panel - much better than just some random stock. I don't dabble in the stock market so I'm not 100% sure what I'm looking at here. The * makes sense as an indicator that trading has closed for the day, though.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Here is a first run at something that might fit the bill. It uses the xfce4-genmon-plugin and requires the package "jq" and that you install ticker.sh.
Then use this script in xfce4-genmon-plugin:
...
Great - thanks for taking the time to provide this handy solution.
Since there seems to be interest also from others in such an applet it seems useful to have it as a dedicated applet possibly with additional common features like setting alarms when a quote reaches some target price etc.
In the meantime I'll use your suggestion.
Cheers
Last edited by jt1122 (2021-04-09 16:03:14)
Offline
Genmon is such a great thing!
From that asterisk note, a few thoughts;
Contracts (big) that happen after hours can change the price, but not for 'us'. So the asterisk means it's not 'accurate'. I noticed the asterisk on a stock yesterday that was inflated some 40 cents, and led me to see an institutional buy of 3 million shares happened...the 'real' price at close, and open this morning did NOT retain that 'premium'.
Next, as far as alerts and the like - be careful! The data from this is delayed at least minutes if not more. Great things happen in seconds! 'F' hit 13.62 the other Monday, it was above 13.50 just long enough for me to dump hundreds, but not all...with limits I ended with 100 unsold. All happening faster than I could type! On a near real time feed I saw the 13.62 for literally seconds - that doesn't show on most 'smoothed' graphs after the fact - and a utility like this would certainly miss it.
Like a lot of things in our world - real actionable information cost real money. I'm going to trim the '.00' and a '$' out of my display to be more obtuse. This is fine for a quick glance, and greatly satisfies my inner geek, but is not suitable as a primary indicator.
For the most part, any source within a minute of accuracy is only available behind a logged on qualified account. Trading records are timestamped to the BILLIONTH of a second!
GME is going to be THE case study of manipulation.
Offline
Genmon is such a great thing!
...
Thanks for the interesting read.
I'm not day-trading hence I don't need microsecond quote accuracy but I do want to see trends and adjust stop loss/loss limits dynamically.
As I've suggested it would be useful if there was a dedicated stocks applet on xfce.
Cheers
Offline
As I've suggested it would be useful if there was a dedicated stocks applet on xfce.
Cheers
agreed, but this is working pretty well.
I did answer my question! With the script I made up to populate a file with the ticker.sh output, I just pointed the txtclick to the script!
echo "<txt>${ACCT%%.*}</txt><tool>$ALL</tool><txtclick>tickpop.sh</txtclick>"
Interval problem solved!
Offline
Unfortunately anonymous access scripts has stopped working. Bummer
Offline
Indeed. I also wrote a small script which fetches the quotes & runs with genmon. No quotes being provided now .
Offline
Looks like Yahoo may have changed something. See: https://github.com/achannarasappa/ticker/issues/246.
Edit: Another interesting post/thread: https://lemonfool.co.uk/viewtopic.php?p … dd#p583902
Last edited by ToZ (2023-04-20 11:39:39)
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
They're back!
Offline
If anyone is using the ticker.sh file mentioned above, make sure you re-download the latest version - it now includes the fix to Yahoo's cookie requirement change.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Confirmed. It's also working again (with the script I wrote).
Offline
It's down again
Offline
It is down. It's been spastic, so I have not started a competing thought yet...I like simple and don't have any alternatives yet.
Offline
If you are using ticker.sh, the branch that gets the session crumb first is working for me: https://github.com/pstadler/ticker.sh/b … /ticker.sh.
More info: https://github.com/pstadler/ticker.sh/issues/37.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Indeed,
API_ENDPOINT="https://query1.finance.yahoo.com/v6/finance/quote?lang=en-US®ion=US&corsDomain=finance.yahoo.com"
Original v7 swapped for v6 and working, Thanks ToZ!
Offline
Pages: 1
[ Generated in 0.015 seconds, 7 queries executed - Memory usage: 640.18 KiB (Peak: 673.02 KiB) ]