Has AI + Advanced Statistics Made Traditional Technical Analysis (TA) Obsolete?
Thanks to EODHD.com for the price data that make my posts possible. When you need high quality financial markets data, you can rely on EODHD.com-they are the best. EODHD clients who are financial modeling enthusiasts or funds are welcome to contact me for writing or analysis tasks: tiankhean@gmail.com. I live in Singapore so there may be time zone differences to take into consideration
Introduction
When we are
not using fundamental data for investment analysis, we use price and volume
data (Open, High, Low, Close, Volume).
RSI, MACD,
Moving Averages, Stochastics and all those TA tools. They may be useful for
visualization of momentum, trading range, volatility, reversion to the mean and
so on. But when it comes to probabilistic predictions, clustering and classification
for arbitrage, portfolio optimization or complex pattern recognition, advanced statistical
techniques have a clear edge. Many of these
techniques have always been there, but their implementation was a challenge.
But now, with Large Language Models, Agentic AI able to do all the coding, fetching
and analysis of data and with available open-source libraries such SciPy,
SciKit-Learn, NumPy, Matplotlib, Seaborn etc it is really quite easy to build sophisticated
models for investment analysis.
Case Study
The top
holdings of a Fund I am invested in include the following companies: Altria
Inc, Seagate Technologies, Kumba Iron Ore, Cogent Communications Group, Annaly
Capital Management. The Fund is a conservative low-risk fund that targets
sectors and industries that are fundamental to a modern economy and are
therefore resilient. The fund hopes to achieve an annual performance of 6.5%
with option to distribute monthly dividends. It hedges its portfolio with
derivatives when necessary.
Using just price data, I want to plot a chart
for each of these companies that will include a 40 business days ahead probabilistic
forecast with confidence levels demarcated.
Why
these five fit a conservative, resilient mandate
Below are
concise profiles for each company focused on fundamentals, stability, and
defensiveness, with emphasis on dividend durability, cash generation, and
economic-importance.
Altria
Group, Inc. (MO) — Consumer staples cash engine
Business:
Leading U.S. tobacco company (Marlboro), with investments in smokeless/nicotine
alternatives and a large stake-driven capital allocation discipline.
Financial/Dividend:
Historically very high free cash flow conversion and a long record of dividend
increases; management targets high payout ratios supported by stable pricing
power. Recent communications indicate continued dividend growth and strong cash
generation.
Resilience:
Tobacco demand is historically inelastic and recession-resistant. Pricing power
and low capex support sustained cash returns.
Key risks:
Volume declines in combustibles, regulatory/tax pressure, litigation; mitigants
include pricing, portfolio shift to reduced-risk products, and disciplined
capital returns.
Why
appropriate: Offers reliable, above-market income and cash
predictability—hallmarks of conservative funds seeking stability over high
growth.
Seagate
Technology (STX) — Critical data infrastructure, cyclical but cash-focused
Business:
Designs and manufactures hard disk drives (HDDs) used in hyperscale data
centers, nearline storage, and enterprise/edge devices. Exposure to AI storage
demand via high-capacity nearline drives.
Financial/Dividend:
Longstanding focus on returning cash through dividends and buybacks across
cycles; benefits as storage cycles upturn with AI workloads. Capital intensity
managed, with operating leverage in upcycles.
Resilience:
Data creation and storage needs are structural; HDDs remain cost-advantaged at
scale for cold/nearline storage, underpinning long-term relevance even
alongside SSD growth.
Key risks:
Industry cycles, pricing pressure, component supply, and competition from
flash; mitigants include technology roadmaps (e.g., HAMR [Heat Assisted
Magnetic Recording), high-capacity mix shift, and hyperscaler demand
visibility.
Why
appropriate: While cyclical, Seagate pairs structural data growth with
disciplined capital returns—suited for conservative income strategies with
tolerance for measured tech cyclicality tied to essential infrastructure.
Kumba
Iron Ore (JSE: KIO) — Essential materials with disciplined payouts
Business:
South African iron ore producer (Anglo American majority-owned), supplying
high-grade ore to global steelmakers.
Financial/Dividend:
Historically strong cash generation in high-price environments and known for
generous, policy-driven dividends when conditions allow. Balance sheet
conservatism supports distributions through cycles.
Resilience:
Steel is foundational to construction, energy, transport, and
manufacturing—core to modern economies. High-grade ore can command premiums
that cushion downturns.
Key risks:
Iron ore price volatility, logistics (rail/port) constraints, currency and
country/regulatory risk; mitigants include cost discipline, quality premiums,
and shareholder-aligned capital policies.
Why
appropriate: Provides commodity-linked income exposure to a fundamental
industrial input, with high-grade advantage and prudent capital returns—fit for
diversified conservative funds that balance defensiveness with resource
cyclicality.
Cogent
Communications Holdings (CCOI) — Backbone internet with contractable cash flows
Business:
Global Tier 1 internet service provider focused on fiber backbone and
high-capacity connectivity for enterprises, carriers, and data centers;
wholesale/retail IP transit and dedicated internet access.
Financial/Dividend:
Known for frequent dividend increases and strong recurring revenue
characteristics; asset-light relative to telco incumbents with disciplined cost
structure.
Resilience:
Internet bandwidth is a utility-like necessity for modern commerce and cloud
workloads; diversified customer base across geographies and verticals reduces
idiosyncratic risk.
Key risks:
Pricing pressure in IP transit, competitive overbuilds, customer concentration
in some segments; mitigants include scale peering, network efficiency, and
long-term contracts.
Why
appropriate: Subscription-like revenue, essential infrastructure positioning,
and a shareholder-friendly dividend policy align well with conservative,
income-oriented mandates.
Annaly
Capital Management (NLY) — Agency MBS income with interest-rate risk management
Business:
Mortgage REIT primarily investing in agency mortgage-backed securities (MBS) (government-guaranteed),
funded via repo with active hedging of interest-rate exposure.
Financial/Dividend:
Dividends funded by net interest income; earnings power tied to spreads and
effective hedging. Agency focus reduces credit risk, making it a more
conservative mREIT segment.
Resilience:
Housing finance and agency MBS markets are core to the financial system;
liquidity and government guarantees underpin credit safety through cycles.
Key risks:
Interest rate volatility, spread widening, funding and leverage management;
mitigants include seasoned risk management, dynamic hedge books, and an
agency-heavy mix to minimize credit risk.
Why appropriate: Offers elevated income sourced from a government-backed
asset class, aligning with conservative funds that value credit safety while
accepting managed interest-rate risk.
Why
these holdings are uniquely attractive for a conservative, resilient fund
Essentiality: Tobacco (inelastic demand), data
storage (AI/cloud), iron ore (steel backbone), internet backbone connectivity,
and agency MBS (housing finance) are pillars of modern economies.
Cash and Dividends: All five have track records of
distributing cash—via dependable dividends (MO, CCOI, NLY) and policy-driven
payouts (KIO), with Seagate and Altria known for buybacks as well.
Diversification of risk: Mix of consumer staples,
tech infrastructure, basic materials, communications infrastructure, and
financials reduces correlation and smooths portfolio volatility.
Downside characteristics: Pricing power (MO),
long-term storage demand (STX), high-grade ore premiums (KIO), recurring
contracts (CCOI), and government-backed credit (NLY) support resilience in
downturns.
Methodology
An Ensemble
of Gradient-Boosted Decision Trees. We will use the open source LightGBM
gradient-boostng algorithm.
Key ideas
• Gradient boosting: builds trees
sequentially; each new tree focuses on correcting the errors of the prior
trees.
• Decision trees: split the feature
space into regions using rules
• LightGBM specifics: Histogram-based
splits for speed.
• Leaf-wise tree growth with depth
constraints for accuracy and efficiency.
• Handles missing values natively.
• Works well with many features and
large datasets.
• Supports quantile loss*, so you can
forecast intervals (e.g., 10th/50th/90th percentiles).
Advantages
• Captures nonlinearities and
interactions between drivers
• Flexible: you can include
engineered features (lags, rolling means/vols) and exogenous variables.
• Produces strong short‑term forecasts when you avoid data leakage and validate properly.
• Train quantile LightGBM models
(e.g., quantiles 0.1, 0.5, 0.9) to get forecast bands.
What is
quantile regression?
• Instead of predicting the
conditional mean of y given X (like ordinary regression), quantile regression
predicts a chosen conditional quantile (e.g., the 10th, 50th, or 90th
percentile).
• Example: A 0.90 (90th) quantile
model predicts a value such that, given today’s features, the stock has about a
90% chance of being at or below that number in the future.
Why it’s
useful:
• It gives you full predictive
distributions (not just a point), which you can turn into uncertainty bands
like [q10, q90] around the median.
• How we forecast “by quantile”
• We trained separate LightGBM models
for each quantile: alpha = 0.1, 0.5, 0.9.
• At prediction time, we run the same
features through each model to get q10, q50 (median), and q90 for each future
date.
• The q50 is your central forecast;
[q10, q90] is an 80% prediction interval.
What is
quantile (pinball) loss?
Quantile
regression is trained with the quantile/pinball loss, which is asymmetric and
depends on the target quantile q in (0,1). For true value y and prediction
y_hat:
If y ≥
y_hat, the loss is q × (y − y_hat)
If y <
y_hat, the loss is (1 − q) × (y_hat − y)
Therefore:
L_q(y,
y_hat) = max(q × (y − y_hat), (q − 1) × (y − y_hat))
• Intuitively: For q = 0.9,
under-predictions (y above y_hat) are penalized 0.9 per unit error, but
over-predictions are penalized 0.1 per unit. The model learns to place its
prediction high enough so that roughly 90% of realizations fall below it.
• For q = 0.5, this becomes symmetric
absolute loss, so the model learns the conditional median
The charts of the 5 companies featured: Ticker Symbol, Visualization and Interpretation
Altria
Group Inc (MO)
Interpretation:
High upside potential. q50 (OOS) is the median out of sample forecast. Its position
above the forecast band is an indication of potential upside-the greater the
distance from forecast band, the higher the degree of probabilistic upside.
Seagate
Technologies (STX)
Interpretation: High upside potential. q50 (OOS) is the median out of sample forecast. Its position above the forecast band is an indication of potential upside-the greater the distance from forecast band, the higher the degree of probabilistic upside.
Interpretation:
Moderate upside potential. q50 (OOS) is the median out of sample forecast. Its
position above the forecast band is an indication of potential upside-the
greater the distance from forecast band, the higher the degree of probabilistic
upside.
Cogent
Communications Group (CCOI)
Interpretation.
Downside shows very significant potential improvement, though still below
forecast band. q50 (OOS) is the median
out of sample forecast. Its position above the forecast band is an indication
of potential upside-the greater the distance from forecast band, the higher the
degree of probabilistic upside.
Conclusion
Conclusion
It looks
like the fund I am invested in is remarkably able of picking stocks that are able to achieve its
objective.





Comments
Post a Comment