149 comments

[ 3.4 ms ] story [ 237 ms ] thread
Edit: Oops, thought this was a Show HN.

Looks pretty clean.

If you want a fun feature to build, add tiny sparkline graphs. Maybe pressing z/x/c/v can switch between last hour/day/month/year charts on each stock item.

Check out https://github.com/holman/spark for how to make graphs with simple character glyphs.

I realize my problem with terminal programs like this is that I forget to ever use them. That's why I prefer something like a macOS menubar app that I can toggle to run at startup.

It's amazing how many times the original author finds out about random HN posts anyway...
Many of us don't use macOS, there are plenty of mac apps for stock tracking.

My only complaint is it's always going to be 15 minutes behind if you're using public sources, otherwise I love it!

Yahoo Finance API is real-time for Nasdaq and NYSE. Delayed for most other exchanges though.
tmux. I have a set of tmux panes which show my current financial status. It's just a couple keypresses away when I'm on the terminal. Things like this, or a terminal weather app, can easily become a quick dashboard using another set of panes. But I practically live in emacs so being on the terminal is natural to me.
>>> Oops, thought this was a Show HN. <<<

If you don't mind, can you explain the difference between this type of Post and a 'Show HN'? Is it that this one was not submitted by the person who built it whereas the requirement of Show HN is that the submitter must be personally involved in the project?

Would be good to add support for trading indicators like MACD, RSI, etc.
You have no idea how useful this is for me. I have nativefier wrapped yahoo finance/msn money/coinstats etc which are all pretty bloated and this gives me all I need with around 1% overhead. Many thanks.
Nice tool! The ETH-BTC pair is limited by the 2 decimals display, for instance, is this configurable somewhere? It would also be great for crypto traders to source all trading pairs available on coingecko.com, not just the few available on yahoo finance :)
This seems very nice and I'll definitely give it a shot. If you're looking for something simple, try ticker.sh[1].

[1] https://github.com/pstadler/ticker.sh

Looks cool! Also thanks for exposing me to jq, that will come in handy for sure.
(comment deleted)
It's nice, what API's is the author using I wonder? All free stock APIs that I checked are no longer functioning, only paid products remain.
It's right there, in the readme -

  Notes
  Real-time quotes - Quotes are pulled from Yahoo finance.
> Real-time quotes - Quotes are pulled from Yahoo finance which may provide delayed stock quotes depending on the exchange. The major US exchanges (NYSE, NASDAQ) have real-time quotes however other exchanges may not. Consult the help article on exchange delays to determine which exchanges you can expect delays for or use the --show-tags flag to include timeliness of data alongside quotes in ticker.

The ReadMe says Yahoo Finance.

Looking at the European landscape, venues are required to make trade & price data freely available 15 minutes after publication - it'd be an interesting project to build something to aggragate these.
Does it provide real time quotes for options as well?
Love this! Would love to see more features in there I know someone mentioned charts which is great! Other features could be news/fundamentals! Let me know if you want to brainstorm my Twitter is in my bio. I used to work at a data vendor that competed with Bloomberg have plenty of ideas!
What are people doing that requires this?
Being bored at a desk job, would be my guess.
Yep, many FAANG employees got rich trading during lockdown.
They all went busto yesterday.
Only if they went all in on an overvalued meme stock like GME; if they put money in an index, like the one that follows the S&P 500, they would be up by anywhere between ~10% and ~45% depending on when they got in. Long-term, broad-spectrum trends have always been upwards.

TL;DR don't bet all your money on one horse. stock. whichever.

(This is not financial advice, I am not a financial expert, and results from the past are not representative of future results)

Market was up almost 2% yesterday, great day for anyone over the age of 20
Can't tell if this is sarcasm but this is, on balance of probabilities, not true.
Lockdown was an incredible easy time to make money. The market is up over 50% from the lows. Was an incredibly easy time to make a lot of money with very little effort or skill
People who had the spare cash lying around to "buy the dip" of the March 2020 crash (https://en.wikipedia.org/wiki/2020_stock_market_crash) caused by coronavirus panic and held their stocks until now have enjoyed 58% growth of their investment even when picking dumb index funds (e.g. S&P 500: 2237.40 at 23.03., current 3826.31).

Crises of this magnitude always benefit those with liquid assets / cash who can afford to buy out those who have to exit out of (financial) pressure and ride out the crisis. The 2008ff crisis was just the same - whoever bought a house at fire-sale foreclosure rates back then now has a lot of net worth.

(comment deleted)
"Require" might be a strong word.

But here is why I find this project attractive: I like to check out my watchlists and stock investments occasionally when taking a quick break. But, I want to avoid being sucked into the browser where the temptation is strong to check out reddit/hn/twitter, and then lose 15-20min.

With this, I can just keep a terminal tab that I can flip to with a hotkey. This way, I won't leave the terminal, and the risk of additional distraction is lower.

Psychology, monitoring long term investments closely is a bad idea. Very seldom is price information actionable, and can easily lead to frustration or boredom induced action.

99.99% of investors should buy and hold and forget. If you have the intelligence and interest to earn your CFA, you should do your valuation analysis to set your buy and sell prices for potential targets, and ignore their price action until they near a target range.

What if your investments aren't long term?
Then you are not an investor, you are a trader. And if you are a trader, you shouldn’t be distracting yourself by writing code during market hours.
Not sure if I agree, although I'm sure it varies per person. I've been investing for > 20 years, and I enjoy watching the daily movement as it helps me keep a mental model of trends and performance. I seldom sell, but do buy regularly, and I think having this information frequently refreshed in my brain has helped my performance (of course, no way for me to do an A/B comparison there, so I can't assert it as fact).
A Buffett story you might find interesting. He refuses to look at the stock price of any potential investment while he is doing his valuation for it.

His thinking is if he falls in love with the business while reading their financial reports, and he knows the stock is trading at $10, he’s subconsciously influenced to bias his valuation estimate over $10, because he wants to buy it.

So he waits to ensure his valuation is as unbiased as possible, and only when finished checks the price. Kind of like the excitement of opening a present at XMas, not knowing if it’s a lump of goal or new AirPods.

This is exactly what happened to me as I type this. I went to check on futures after yesterdays rally, and 20 minutes later I'm commenting on this post. Use case validated
I imagine it might show up in the background of some FinTech hacker movie at some point.
(comment deleted)
The application uses Yahoo finance to fetch the market information. It is generally delayed by 30 minutes for exchanges like AEX or other european exchanges.

What I generally do it query the endpoint in EURONEXT's portal https://live.euronext.com/en/intraday_chart/getDetailedQuote... directly to get the current stock information which is almost real time.

You can also track intraday price from EURONEXT via - https://live.euronext.com/intraday_chart/getChartData/FR0000...

Try Monitoro[0] on that website to setup alerts with Slack, Discord, IFTTT, Zapier ... painlessly, no code. Our delay is 1-2 seconds at most to delivery so you should get it pretty fast.

(Disclaimer: I'm the founder)

[0]: https://monitoro.xyz

(comment deleted)
On latest chrome, when I scroll down the homepage, the links in the header no longer work (no hover state or click handling). Project does look interesting btw.
This looks a lot like WrapAPI[0] which I found a while back researching for Postman Galaxy hackathon. How are you guys different?

[0]: https://wrapapi.com/

These things look to have completely different use cases.
A see a lot of these that use Yahoo Finance API - AFAIU, it was deprecated many years ago and I guess might be in something close to a "forgot to switch off" state.

I wonder how much will break when they finally turn it off.

There's still also a lot of apps around obviously using the Yahoo Finance API. Apps with hundrets of thousands of downloads. I'm curious as well.
Doesn't the ios stock app also use yahoo finance api as well?
Yes both the iOS and MacOS use yahoo finance api as well. Perhaps Apple is paying the bill here.
One difference between this and Apple: Apple's apps show the news stories when you pick a stock where Yahoo presumably can get ad revenue. I doubt this gets popular enough to be targeted though.
Funny only recently I noticed the ads in the Stocks app and thought it was very un-apple
It looks like the same API that the Yahoo Finance website calls (via react)
fwiw, idm, ISTR it being turned off around 2018, so I'm surprised to see it working again.
-> for what it's worth, Internet Download Manager, Investar Holding Corp it being turned off around 2018...

Thanks for clarifying

Anything like this with watchlist that dynamically populates based on highest and lowest momentum?
For anyone looking for a Yahoo Finance API alternative, try http://alphavantage.co/
A free API key is great, but what is the catch? The whole Robinhood drama about them selling data to third parties has me leery about anything "free" in finance SaaS.
It's tiered. They have a "pay me" tier.
I totally missed that. Thanks!

edit: For those wondering what the price is it's on this page https://www.alphavantage.co/premium/ which is not very apparent from the front page.

Sadly the limits for the free tier look too low to even run this CLI ticker application off of it (or is it possible to query more than one symbol in one API call?).
FWIW, last year I was playing with this API and they were not verifying the key properly: just appended anything at the end of the key and it worked.
Robinhood drama isn't "selling data" it's selling access to fulfill bids.

It's akin ordering delivery from a store and having Instacart be the only option.

Most of the drama was misinformed speculation. A bit was suspicion that the order fulfiller was untrustworthy (because the reason they are willing to provide the service is that they know you will make bad trades, so what happens if you make a good trade that makes them lose money?)

(comment deleted)
Eh, no websocket for prices? I like finnhub (https://finnhub.io) or alpaca (https://alpaca.markets/) better.
I forgot to write "a [free] alternative to Yahoo Finances"
public websockets API? Doesn't that introduce a lot of scaling issues for the API provider?
Not really. A websocket is "just" a TCP connection.

If the API provider is using a language+framework that can't easily handle lots of concurrent TCP connections, then yes, that could cause scaling issues, but... that's a choice.

There are plenty of ways to build scalable socket servers, and it's especially feasible in languages like Go and Elixir.

i thought websocket pattern requires statefulness on the server side. That's the finite constraint that I'm thinking of.
Server side state can take many forms. In general, you already have to track state per customer anyways, and that often goes in a database. You can also keep per client state in the database too, if it won’t fit in memory for some reason.

idk, it all depends on what you’re using the websockets for. If you have to send messages from one websocket client to another, things can get harder because those two websockets might not be connected to the same server.

I cant find any info regarding this, but do they have data on global exchanges? More specifically those in Asia?
What would you say pros and cons are compared to yahoo?
It's a supported API, with free and paid plans. The Yahoo API has been officially dead for years, they just didn't pull the plug yet.
Yeah, the state of Yahoo is really strange. It's still the best free one I've found. Why I'm looking for alternatives..
would this be considered best practices in terms of organizing and testing a go package?

I'm brand new to the language, so curious if this could serve as a reference project? For example, I'm not sure if it's standard to use resty for a rest client as seen in this project?

Awesome! Anyone know a similar project in Python?
I hope you support banana and show a diamond for every 100% gain
This is neat and very cool, just installed it!

Since we're talking about API's and finance and not to hijack the thread, does anyone know or recommend an economic calendar REST API feed?

How is it that pretty much all stock trackers / APIs only support US symbols? There are so many stocks out there that don't have a symbol and have an ISIN. Is everybody only trading symbol-based stocks? That seems very limited to me.
Nice! This would be great if it could output HTML, then I'd configure it with the Yaml, make cronjob on my homeserver to auto update and point my browser to it (or more like point it to the nginx container behind my traefik container). But still, this is also very nice, will install tonight.

I made something like that myself with the Bittrex API (for crypto) once myself (based on Python and pandas.DataFrame.to_html()), very useful.

This is very well done. Didn't realize Yahoo APIs were still live. I made one using IEX.

https://stockdaddy.io/samples/dashboard/

They offer an excellent API for a very reasonable price and offer it free to people if you're interested in a more comprehensive solution for free. Also, take a look at IEX if you're interested in getting into financial APIs.

Is anyone really using any of these stock trackers (including those built in in OSX etc? I think the whole idea is broken. This is why:

If you are interested enough to regularly check the price of certain stocks and indices you know that the most important thing is that the shown price is CORRECT. And you know that the most trustworthy way to get a correct price is to go directly to the largest brokers and the largest and most trusted portals like Investing.com and Marketwatch.

On the other hand if you don't care that much. Why the hell would you like to have a special application for checking when you could as well go to any of the above?

I play with fake money, in a Discord server with a bot we made and a few friends. Sure, I'm probably not the norm, but I find them useful :).
This might be the only real use case haha
I feel like it's an excuse to write a CLI app in your favorite language. I dig it; tempted to clone it in python.
Nothing wrong with that! :)
This was my thought too- it seems like a really fun and clean and data-driven coding project, whether it's actually useful or not
If you're a long-hold investor who lives in the terminal, it's perfectly fine. Plus watching GME crash in ASCII is entertaining.
I would't call it perfectly fine. It's still not trustworthy enough. You would certainly want to double check it, which in turn makes it rather unnecessary in the first place.
You need an account with a broker to see prices with sub-minute resolution. If you need that, you likely trade seriously, and have more serious tools from a broker or two anyway.

But if all you want is to watch trends, not do HFT, being even 5 minutes late is fine. Even just looking at how a day went after hours is fine.

I typically keep a Windows VM running for the main purpose of using my brokers very powerful trading desktop application. While it is very useful and can do all sorts of calculations & graphing, it is kind of slow and the UI is a little cumbersome. The number of clicks to add a stock to a watchlist is very high, etc. In comparison, it takes 1 button to add a stock to mop [1] and I can keep it in a 'dropdown' terminal window controlled by a keyboard shortcut.

Unless you are a HF trader, you probably only need the stock price within a few minutes unless you are about to place a trade. (And typically all these terminal stock tickers are doing is scraping these sites anyway so the data is about the same.) Therefore, during the day I can watch stocks in the comfort of my terminal using mop [1] (or this if this has more features and is as easy to use), and if anything strikes my eye I can then go to my stock trading terminal and watch things more precisely.

I also do have a custom search engine that can open any stock ticker to finviz.com but I'd rather not have to have yet another account on some random website that either has distracting ads and/or pushes me to pay for more features.

There is a very large UX vs features trade off when it comes to anything stock related so it makes sense to use multiple tools.

What’s the desktop application you are using? Sounds interesting
If I had to guess, the Fidelity Active Trader Pro app.

It's a pretty handy app, that seems to be constantly up to date, but it's garbage on Mac, so I setup a PC laptop next to my main setup so I can have it running. Still a bit finicky on PC, but way better.

(comment deleted)
I remember what the stock market mood was like in early 2000. Everyone breathlessly watching their favorite stocks, IPOs jumping 100%+ on first day of trading, tech companies entering large indexes...

This year feels exactly the same as 21 years ago, but people are saying it's different because of Covid, Fed buys, etc.

Then again, "this time it's different!" is the rallying cry at the peak of every bubble.

"This time it's different!" is also the rallying cry for people trying to time the peak ;-)
I’ve heard this sentiment call hundreds of tech bubbles since the dotcom boom, and we’ve seen only one in an unrelated sector. I am not saying it isn’t a bubble, just that market enthusiasm tends to look like a bubble but happens all the time without crashing everything.
This is the correct take on it. That kind of analysis has predicted eighteen of the last three bubbles.

The problem is that while, say, stocks are frothy, eventually inflation catches up to the froth - so even when the crash happens, you end up better off than if you sat the frothy market out on the sidelines.

It doesn't help to be right in the direction of the market, when you're wrong in the timing of it.

Agreed. As much as I wished I had sold some positions last February when it was clear something big was building in Asia, I am confident that I wouldn't have had the guts to buy back in after the crash and would have missed out on the rebound gains.

In the end, I'm probably better off having held and continuing to buy every couple of weeks throughout than trying to time the market swings from COVID.

> As much as I wished I had sold some positions last February when it was clear something big was building in Asia

I did this.

> I am confident that I wouldn't have had the guts to buy back in after the crash and would have missed out on the rebound gains.

I did this too.

> In the end, I'm probably better off having held and continuing to buy every couple of weeks throughout than trying to time the market swings from COVID.

I wish I'd done this.

Would you mind sharing some of your experience? I'm super interested.
What's possibly different with this alleged bubble is the influx of retail into the market and day trading in general. The wallstreetbets sub has grown at least 3x during this episode, and I know personally of several people who were previously uninterested in stocks now looking to trade.
Sure, but then the argument for it being a bubble is “it is different this time.” It could be, I don’t know! But plenty of interest in retail investing has not resulted in a bust before.
Exactly, the market is definitely overenthusiastic which we can call a bubble. So we keep on hearing all those claiming it is a bubble in the sense that it will imminently "pop" because people will always want to say "I predicted the bubble will pop". So they will wake up every few months (when the market peaks yet again) and shout "bubble, bubble" so that just in case it happens now they can be the foresighted ones.

The amount of times we've heard "bubble" over past few years, even while/if true, in of itself keeps people from taking it seriously.

So many people fail to see this. The number of stock market "investors" making Tik Tok videos and people gambling with rent money might even be worse than 2000.
People are bored and trapped at home. It isn't that surprising that day trading as a hobby has picked up a little.

A market correction wouldn't be that surprising in general, but keep in mind a bubble and a correction aren't the same thing. Plus, and maybe more importantly, even know a correction could occur without knowing when isn't actually actionable information (could be tomorrow, next year, or three years from now, and you would lose money if you react at the wrong time).

So people saying we're in a bubble/correction is due, what action would you have people take? If the answer is "nothing" or "I don't know" then what good is that?

>what action would you have people take

People can obviously do whatever they want as long as they're aware past performance...blah...blah...don't invest more than you can lose...blah.

I've pulled out from everything with a rich P/E ratio and am only keeping money in companies that I feel are a) stable and b) have a reasonable-to-low P/E ratio.

My thought is that new investors tend to go for well-known companies or meme stocks, but either way driving up the P/E ratio. I don't want to be caught in the downswing when these investors leave.

The difference here is understanding that investing and gambling are not the same thing. If they are investing for retirement and buying low cost index funds, I would do nothing. If they are gambling due to the dank memes, I would ensure that I wasn't gambling anything I couldn't afford to lose.
People have also been steadfastly insisting the market will crash again for… well, actually, I don’t think it’s even stopped briefly since the recession.

During the recession we were told that the days of 10%+ YoY returns in the market were over and that we could expect to live in a world with 3%–5% from here on out. The market meanwhile has gone up fivefold in the interceding 12 years, or roughly a 15% annual return.

All along the way have been the doomsayers insisting that the market will crash, that it feels like 2000 all over again, that Trump, or COVID, or Biden will destroy the stock market, that being at all-time-highs, having an unprecedented CAPE ratio, or quantitative easing is going to send things tumbling… and yet here we are. Sure, the crash will come at some point, but given the thousands of failed predictions I’ve seen in the past twenty years I have zero faith in anyone’s individual ability to correctly guess when it will happen.

2012-2019 offered great returns, but it didn't have the same breathless mood as prevails now.

Taxi drivers want to talk about stocks. Every graph is looking parabolic. Day trading has boomed. Last time these things happened was 1999-2000.

Okay, do what's your play, here? You sit 2021 out, the s&p froths up to 5.5k over the next 18 months, and then crashes down to 3.7k? And you perfectly time buying the dip? (Unlikely.)

You'll still lose money, compared to just buying and holding.

Owning stocks is a good idea. But if you just buy the S&P every month, you probably don't need a "terminal stock watcher and stock position tracker", which is the program being discussed here. It seems like a symptom of a short-term exuberance that may not end well for most participants.
You can split up your buying and skimming profits over time so your building a position over many months to years and periodically taking profits near the tops and rebuying and increasing position every couple weeks when the market corrects.

Also another great thing to try is get SPX/USD on 500:1 leverage so on a good day when S&P goes up 2% with the leverage multiplier can significantly increase return.

-> Then again, "this time it's different!" is the rallying cry at the peak of every bubble.

It is different!

Trillions of dollars magically printed by the Fed. Bitcoin, Doge Coin, Robinhood, Covid, GameStop, Trump, insurrection...

Fiat currency always ends the same, it's the duration of the fiat currency that I believe is the variable.

While I do think the low global interest rates, national debts, general housing prizes, and, real valuable estate being hogged by hedge funds makes things significantly different from the 2000, I don’t think middle class stock options have. Sure you have fewer options because of the things I mention, meaning the only place to keep minor wealth is in stock, but the danger isn’t different.

Diversify and put most of your money into boring industries like water and energy companies that aren’t stuck on a single type of fuel, and you’ll be alright.

People who shoot for the moon are playing the lottery and most of them are going to lose. It’s always been like that, and I don’t think that’s different now.

I’m much more worried about the inequality we’ve created. I’m a boring investor, and the worst stock I have from 2000 is Vestas, and it’s up around 900% since then. This isn’t take me to the moon money like the gamblers who get it right earn, but it’s 900% more than all the people who live pay check to pay check.

I don't know in early 2000 but this time everybody's calling it by its name, a bubble.
So the important questions then are 1) is it actually different? and 2) if it is different, is it different in a way that prevents or mitigates a bubble? I could see things like COVID and Fed interventionalism changing the dynamics such that a bubble is harder or less damaging when it pops. I could also see the opposite. I just don't know, and I was entering my freshman year of HS in 2000 so I don't really remember what it was like to be working and invested in the market at that point.
If you're going to pattern match, you're almost always wrong calling any specific moment a bubble.

The S&P 50 has closed within 5% of its all-time high 32% of days for its entirety. 1 out of every 15 days the market closes at an all time high. And the vast, vast majority of those don't end up being the precipice of a crash. In fact, even the ones that do predate a crash almost always end up being perfectly fine times to invest for long-term growth.

The null hypothesis really should be that most markets aren't bubbles. So, a "why is this time it different" argument should be required from people calling it a bubble, not from those saying it's not.