Investing
Stock screeners, market data and finance tools. 33 posts, newest first. All topics
AI Investing Research Systems: ai-berkshire and the Agents Built on BuffettHow ai-berkshire turns Claude Code into a four-analyst value investing team, how it compares with TradingAgents, and what research says about LLM stock picking.
Computing CAGR, volatility, Sharpe ratio and max drawdown in PythonCompute CAGR, annualised volatility, the Sharpe ratio and maximum drawdown from daily prices with pandas, and avoid the annualisation and return-type mistakes.
Pulling company fundamentals from the SEC's XBRL company facts APIFetch revenue and net income for US-listed companies from data.sec.gov: CIK lookup, companyfacts and companyconcept, us-gaap tags, and deduplicating 10-K facts.
A portfolio rebalancing calculator in PythonWrite a rebalancing calculator in plain Python: target weights, drift, rebalance bands, putting new cash to work before selling, and rounding to whole shares.
Backtesting a moving-average crossover in pandas without look-ahead biasA vectorised pandas backtest of a 50/200-day crossover: signals on the close, trades on the next bar, transaction costs, and why one price series proves nothing.
How I implemented a stock screener in Python, part II: the scannersThe JSON config and two yfinance scanners from my stock screener: one flags big high-low ranges, the other finds liquid penny stocks and posts to Discord.
How I implemented a stock screener in Python, part I: scanner interface and ticker listPart I of my Python stock screener, covering a shared scanner interface and a class that loads Canadian and US tickers as Yahoo Finance symbols.
Downloading investor presentation audio from a webcast with ffmpegFind the HLS playlist behind a webcast player in your browser's DevTools, save the audio with ffmpeg, and transcribe it with Whisper.
Scraping HTML tables with pandas read_html and BeautifulSoupPull an HTML table into a DataFrame with pandas.read_html, pick the right table with match=, and use BeautifulSoup for data held in class attributes.
Filtering Reddit posts with Go and sending matches to DiscordHow my finreddit project pulls new posts from several subreddits with the Reddit API, filters them by score, flair and keywords, and posts matches to a Discord webhook.
A TikZ flow chart of liability-driven investing (LDI)A TikZ diagram of how money flows from a company's pension promise into an LDI fund, and why I don't believe in LDI's use of leverage.
Natural gas futures in Python: quarterly averages and moving averages with yfinanceDownload Henry Hub natural gas futures with yfinance, compute quarterly and rolling averages in pandas, and use them to sanity-check a gas producer.
Conscrap 2.0.0: scraping Yahoo Finance comments inside shadow roots with SeleniumWhat changed in conscrap 2.0.0: reading Yahoo Finance comments from shadow DOM with a JavaScript helper, the move to .NET 7, and publishing to NuGet from GitHub Actions.
Getting started with cad_tickers: TSX and TSXV symbols and quotes in PythonInstall cad_tickers, my Python package for Canadian stock exchange data, and use it to list TSX and TSXV symbols, with notes on what no longer works.
Cryptography in Deno: Web Crypto and @std/cryptoHash, sign and encrypt data in Deno with the built-in Web Crypto API, and use @std/crypto for extra hash algorithms and timing-safe comparison.
Building a markdown report from 13F filings with Python and secedgarDownload a year of 13F-HR filings from SEC EDGAR with secedgar, parse the holdings tables with pandas, and write a markdown report with a chart for Pelican.
Credit Suisse's March 2023 crisis: why one bank's troubles worried global marketsHow Archegos, Greensill and a run on deposits pushed Credit Suisse to a Swiss central bank loan in March 2023, and why markets feared contagion.
Why I'm buying SQQQ, a 3x inverse Nasdaq-100 ETF, in a down marketMy reasons for buying ProShares UltraPro Short QQQ (SQQQ) as a hedge in 2023, how its daily -3x reset works, and why it decays when held.
Scraping 13F filings from SEC EDGAR with Python and secedgarA small Python CLI that uses secedgar to list the institutional managers filing 13F reports for a quarter and download their filings from EDGAR.
Streamlit and OpenBB part II: Donchian Channels and st.cache_dataAdding a Donchian Channels chart to my Streamlit technical analysis app, moving from st.cache to st.cache_data, and a caching bug in the file-cleanup decorator.
Transcribing YouTube livestreams with Whisper, part 2: ffmpeg chunks and wit.aiHow fdrtt splits recorded video into audio chunks with ffmpeg, transcribes them with Whisper, and parsed the streamed wit.ai responses it used before.
How I generate premarket stock reports with Python, PyLaTeX and DiscordMy pipeline for premarket stock reports, pulling market events, Reddit posts and economic data into a PyLaTeX document and posting it to Discord.
Transcribing YouTube livestreams with Whisper, part 1: the transcription loopHow my fdrtt project records a YouTube livestream in 4.5-minute chunks, transcribes each with Whisper, and posts the text to Discord from GitHub Actions.
Building a Bollinger Bands web app with Streamlit and the OpenBB SDKHow my Streamlit app loaded stock prices with the OpenBB SDK, rendered OpenBB's Bollinger Bands chart as an image, and what to use now that the SDK is retired.
Asking Bing Chat to convert a Streamlit app to DashI asked Bing Chat to port my Streamlit technical analysis app to Plotly Dash. What it got right, where its code broke, and a working Dash version.
Summarizing YouTube videos with OpenBB 2.5's Whisper pipeline and GradioHow I wrapped OpenBB Terminal 2.5.1's transcribe_and_summarize function in a Gradio app that returns a summary and subtitles for a YouTube link.
A small Gradio web app to transcribe audio with OpenAI WhisperA few lines of Python that wrap OpenAI's open-source Whisper model in a Gradio UI, so you can upload an audio file, such as an investor call, and get a transcript.
A Gradio demo for a spaCy entity ruler that tags stock tickersHow I built a spaCy pipeline that tags stock symbols and company names with an entity ruler, and served it as a Gradio app on Hugging Face Spaces.
Stock technical analysis dashboard with Streamlit, yfinance and pandas-taA small Streamlit app that downloads prices with yfinance and charts SMA, EMA, Bollinger Bands, RSI and price-volume using pandas-ta.
Scrapping comments from Yahoo Finance using dotnet Part 2Explaining how I updated my conscrap project to handle comment formats from yahoo finance
Scrapping comments from Yahoo Finance using dotnetExplaining how conscrap project grabs comments from yahoo finance using selenium.
Analyzing RBC Stock Trades with pythonAnalyzing rbc stock trades with python
building ticker app with plotly dashBuilding stock ticker app with plotly dash
© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)