Nils W's Avatar

Nils W

@optionstocksmachines.com

Options, stocks, machines: Driven by data, Tamed by Python and R https://www.optionstocksmachines.com/ Helping coders invest, and investors code

102
Followers
40
Following
100
Posts
03.11.2024
Joined
Posts Following

Latest posts by Nils W @optionstocksmachines.com

Preview
BOTW 25: Robots to the Rescue Exploiting potential rebalancing candidates among the S&P sector ETFs produces nice risk-adjusted outperformance

๐—•๐—ข๐—ง๐—ช ๐Ÿฎ๐Ÿฑ: ๐—ฅ๐—ผ๐—ฏ๐—ผ๐˜๐˜€ ๐˜๐—ผ ๐˜๐—ต๐—ฒ ๐—ฅ๐—ฒ๐˜€๐—ฐ๐˜‚๐—ฒ: New backtest inspired by Robot Wealth. Go long the bottom half performing S&P sector ETFs from the first half of the month and hold until the end of the month. Risk-adjusted returns exceed SPY for time in the market.

optionstocksmachines.substack.com/p/botw-25-ro...

12.12.2025 14:24 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
BOTW 16: Oil vs. Oil Pairs trading big oil companies Exxon or Chevron vs. oil significantly outperforms XLE and the S&P.

๐—•๐—ข๐—ง๐—ช ๐Ÿญ๐Ÿฒ: ๐—ข๐—ถ๐—น ๐˜ƒ๐˜€. ๐—ข๐—ถ๐—น Pairs trading big oil companies vs. oil the commodity significantly outperforms XLE and the S&P. But a missing component could alter results meaningfully. Stay tuned for the reveal in our next post!

optionstocksmachines.substack.com/p/botw-16-oi...

14.06.2025 18:02 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
HFW 19: Automate ETS AutoETS improves forecasts meaningfully vs. ETS on Apple

๐—›๐—™๐—ช ๐Ÿญ๐Ÿต: ๐—”๐˜‚๐˜๐—ผ๐—บ๐—ฎ๐˜๐—ฒ ๐—˜๐—ง๐—ฆ We compare an additive ETS model against an AutoETS one on Apple's revenues. Forecast errors meaningfully lower for AutoETS. Warrants optimism around AutoETS performance when we test it on the full dataset. Stay tuned!
optionstocksmachines.substack.com/p/hfw-19-aut...

10.06.2025 23:21 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Post image

optionstocksmachines.substack.com/p/botw-15-ey... Recently, while private credit has become investable for individual investors, it hasn't always been. We take a crack at isolating returns to the asset over a 10-year period in recent backtest.

optionstocksmachines.substack.com/p/botw-15-ey...

08.06.2025 19:35 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
HFW 18: Adding the E to ETS Adding an error term to our exponential smoothing trend and seasonality models produces modestly better performance than without the term

๐—›๐—™๐—ช ๐Ÿญ๐Ÿด: ๐—”๐—ฑ๐—ฑ๐—ถ๐—ป๐—ด ๐˜๐—ต๐—ฒ ๐—˜ ๐˜๐—ผ ๐—˜๐—ง๐—ฆ Adding an error term to the exponential smoothing models we use to forecast revenues on our S&P 500 sector dataset improves performance modestly. This sets up nicely to introduce AutoETS in future posts. Stay tuned!
optionstocksmachines.substack.com/p/hfw-18-add...

04.06.2025 12:55 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
BOTW 14: Systematic Factors A long/short portfolio created by ranking factor ETFs using rolling Sharpe Ratios beats the market.

๐—•๐—ข๐—ง๐—ช ๐Ÿญ๐Ÿฐ: ๐—ฆ๐˜†๐˜€๐˜๐—ฒ๐—บ๐—ฎ๐˜๐—ถ๐—ฐ ๐—™๐—ฎ๐—ฐ๐˜๐—ผ๐—ฟ๐˜€ We take a breather from the rarefied air of dividend aristocrats to wade in on factor investing for our weekly backtest. A long/short portfolio created by ranking factor ETFs using rolling Sharpe Ratios beats the market.

optionstocksmachines.substack.com/p/botw-14-sy...

21.05.2025 20:12 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
HFW 17: Smooth Trends Exponential smoothing with trend and seasonality performs as well as simple smoothing but with more realistic forecast graphs

๐—›๐—™๐—ช ๐Ÿญ๐Ÿณ: ๐—ฆ๐—บ๐—ผ๐—ผ๐˜๐—ต ๐—ง๐—ฟ๐—ฒ๐—ป๐—ฑ๐˜€ Exponential smoothing with trend and seasonality performs as well as simple smoothing but with more realistic forecast graphs, a key enhancement for stakeholders that need such details. More enhancements to follow. Stay tuned!

optionstocksmachines.substack.com/p/hfw-17-smo...

19.05.2025 15:33 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Agreed! Thanks for sharing.

14.05.2025 15:40 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
BOTW 13: Doggie Deux Using deciles instead of a top 10 ranking improves our Aristocratic Dog strategy by 10 percentage points.

๐—•๐—ข๐—ง๐—ช ๐Ÿญ๐Ÿฏ: ๐——๐—ผ๐—ด๐—ด๐—ถ๐—ฒ ๐——๐—ฒ๐˜‚๐˜… More Dogs of the Dow with a Twist! Long-short strategy on the top and bottom deciles by dividend yield outperforms by over 50% pts vs benchmark. Second from the top and bottom underperforms by about 10% pts. Real doggie deux!

optionstocksmachines.substack.com/p/botw-13-do...

14.05.2025 15:39 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
HFW 16: Smooth Exponentialer Simple exponential smoothing yields the best performance thus far

๐—›๐—™๐—ช ๐Ÿญ๐Ÿฒ: ๐—ฆ๐—บ๐—ผ๐—ผ๐˜๐—ต ๐—˜๐˜…๐—ฝ๐—ผ๐—ป๐—ฒ๐—ป๐˜๐—ถ๐—ฎ๐—น๐—ฒ๐—ฟ Simple exponential smoothing outperforms the benchmarks on our S&P 500 revenue dataset. But the model produces flat forecasts just like the naรฏve one. We'll resolve that issue in our next post. Stay tuned!

optionstocksmachines.substack.com/p/hfw-16-smo...

12.05.2025 17:39 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
BOTW 12: Aristocratic Dogs Applying the Dogs of the Dow methodology to Dividend Aristocrats yields significant outperformance relative to the benchmark

๐—•๐—ข๐—ง๐—ช ๐Ÿญ๐Ÿฎ: ๐—”๐—ฟ๐—ถ๐˜€๐˜๐—ผ๐—ฐ๐—ฟ๐—ฎ๐˜๐—ถ๐—ฐ ๐——๐—ผ๐—ด๐˜€ Not King Charles Spaniels or the new Tarantino movie. Applying the Dogs of the Dow strategy to the Dividend Aristocrats. Results are impressive. Beats the benchmark by almost 40% pts. Quality investing for quants!
optionstocksmachines.substack.com/p/botw-12-ar...

08.05.2025 17:40 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
BOTW 11: Credit Spread Arbitrage A pairs trading strategy using the ETFs LQD and HYG generates a Sharpe Ratio 20% better than an equivalent 50-50 benchmark on the same ETFs

๐—•๐—ข๐—ง๐—ช ๐Ÿญ๐Ÿญ: ๐—–๐—ฟ๐—ฒ๐—ฑ๐—ถ๐˜ ๐—ฆ๐—ฝ๐—ฟ๐—ฒ๐—ฎ๐—ฑ ๐—”๐—ฟ๐—ฏ๐—ถ๐˜๐—ฟ๐—ฎ๐—ด๐—ฒ Continuing our fixed income theme, a pairs trading strategy using the ETFs LQD and HYG generates a Sharpe Ratio 20% better than an equivalent 50-50 benchmark. More fixed income backtests to follow. Stay tuned!
optionstocksmachines.substack.com/p/botw-11-cr...

30.04.2025 17:25 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I feel there's a wonderful analogy waiting to emerge...

29.04.2025 20:22 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
HFW 14: GARCH Curious G/ARCH models perform better than most models examined to date. But our time series are probably not sufficiently long to allow these models to shine.

๐—›๐—™๐—ช ๐Ÿญ๐Ÿฐ: ๐—š๐—”๐—ฅ๐—–๐—› ๐—–๐˜‚๐—ฟ๐—ถ๐—ผ๐˜‚๐˜€ Key takeaway: G/ARCH models beat most models examined to date in our Hello Forecasting World series. But the naรฏve and autoregressive growth rate models remain at the top. Simplicity wins the day, again!

optionstocksmachines.substack.com/p/hfw-14-gar...

28.04.2025 18:41 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
BOTW 10: MBS for Fun and Profit Pairs trading MTBA vs. MBB, the MBS ETFs, generates tidy risk-adjusted outperformance with or without leverage

๐—•๐—ข๐—ง๐—ช ๐Ÿญ๐Ÿฌ: ๐— ๐—•๐—ฆ ๐—ณ๐—ผ๐—ฟ ๐—™๐˜‚๐—ป ๐—ฎ๐—ป๐—ฑ ๐—ฃ๐—ฟ๐—ผ๐—ณ๐—ถ๐˜ We pair two MBS ETFs, MBB and MTBA. The strategy outperforms nicely, and, generates a Sharpe Ratio double the benchmark. Leverage warranted and while remaining market neutral.
optionstocksmachines.substack.com/p/botw-10-mb...

23.04.2025 20:50 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
HFW 13: ARCH Complex A basic ARCH model performs better than most of the previous models, but is modestly worse than the naรฏve and autoregressive growth rate models

๐—›๐—™๐—ช ๐Ÿญ๐Ÿฏ: ๐—”๐—ฅ๐—–๐—› ๐—–๐—ผ๐—บ๐—ฝ๐—น๐—ฒ๐˜… Addressing volatility in S&P 500 revenue dataset with a basic ARCH model. Bottom line: ARCH beats most others to date apart from the benchmarks. Performs the best on the tech ETF, XLK, More knobs to tune performance!
optionstocksmachines.substack.com/p/hfw-13-arc...

21.04.2025 17:39 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Recession indicators: Sahm Rule I Not a forecasting tool, but no false positives like yield spreads

๐—ฅ๐—ฒ๐—ฐ๐—ฒ๐˜€๐˜€๐—ถ๐—ผ๐—ป ๐—œ๐—ป๐—ฑ๐—ถ๐—ฐ๐—ฎ๐˜๐—ผ๐—ฟ๐˜€: ๐—ฆ๐—ฎ๐—ต๐—บ ๐—ฅ๐˜‚๐—น๐—ฒ ๐—œ Key finding: though not a forecasting tool, the rule does not suffer from the same type of false positives one sees in yield spreads. Our next post will compare the rule to stock market action. Stay tuned!

optionstocksmachines.substack.com/p/recession-...

16.04.2025 20:12 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
HFW 12: ARMA adds little again An ARMA(1,1) model using growth rates performs modestly worse than the AR(1) model, but still better than most of the prior models we've tested thus far

๐—›๐—™๐—ช ๐Ÿญ๐Ÿฎ: ๐—”๐—ฅ๐— ๐—” ๐—ฎ๐—ฑ๐—ฑ๐˜€ ๐—น๐—ถ๐˜๐˜๐—น๐—ฒ ๐—ฎ๐—ด๐—ฎ๐—ถ๐—ป Adding a moving average component does little for performance. But the model does perform better than all the previous ones apart the benchmarks. Time to move on to incorporating volatility into our models. Stay tuned!
optionstocksmachines.substack.com/p/hfw-12-arm...

14.04.2025 19:15 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
BOTW 8: Rolling with AAII Rolling regression on AAII signals improves strategy results meaningfully

๐—•๐—ข๐—ง๐—ช ๐Ÿด: ๐—ฅ๐—ผ๐—น๐—น๐—ถ๐—ป๐—ด ๐˜„๐—ถ๐˜๐—ต ๐—”๐—”๐—œ๐—œ: Rolling regression for the win. We build several rolling regression models, rank them, and then satisfice, rather than optimize. The resulting outperformance on the validation set exceeds 30% points!
optionstocksmachines.substack.com/p/botw-8-rol...

11.04.2025 20:14 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
HFW 11: Autoregressive growth rates An AR(1) model using sequential growth rates takes the title from the naรฏve model for best performance on our S&P dataset

๐—›๐—™๐—ช ๐Ÿญ๐Ÿญ: ๐—”๐˜‚๐˜๐—ผ๐—ฟ๐—ฒ๐—ด๐—ฟ๐—ฒ๐˜€๐˜€๐—ถ๐˜ƒ๐—ฒ ๐—ด๐—ฟ๐—ผ๐˜„๐˜๐—ต ๐—ฟ๐—ฎ๐˜๐—ฒ๐˜€ An AR(1) model using growth rates surpasses the major algorithms we've examined thus far, and is also tiny bit better than the naรฏve model. Next up we'll see if we can improve upon this performance. Stay tuned!
optionstocksmachines.substack.com/p/hfw-11-aut...

09.04.2025 18:30 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

But there's still a 30% probability of negative returns. On a 6-month horizon, the upside exceeds the down by about 18 percentage points. Not bad!

07.04.2025 19:08 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
The 200-Week Empirical probabilities suggest the best risk-reward comes in the 6-month period after the S&P 500 dips below the 200-Week moving average

๐—ง๐—ต๐—ฒ ๐Ÿฎ๐Ÿฌ๐Ÿฌ-๐—ช๐—ฒ๐—ฒ๐—ธ Wall St. strategists are saying the S&P might find support at the 200-Week Moving Average. Classic data analysis shows one-month to one-year returns after a dip below tend to be positive.
optionstocksmachines.substack.com/p/the-200-week

07.04.2025 19:08 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
BOTW 7: Momentum of momentum A pairs strategy using momentum as a signal on momentum and covered call ETFs produces attractive outperformance vs. the benchmark

๐—•๐—ข๐—ง๐—ช ๐Ÿณ: ๐— ๐—ผ๐—บ๐—ฒ๐—ป๐˜๐˜‚๐—บ ๐—ผ๐—ณ ๐—บ๐—ผ๐—บ๐—ฒ๐—ป๐˜๐˜‚๐—บ Pairing the S&P momentum ETF against the covered call variant produces over 50 percentage points of cumulative outperformance vs. the benchmark. Definitely an attractive proof-of-concept. Stay tuned!
optionstocksmachines.substack.com/p/botw-7-mom...

04.04.2025 19:48 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Intraday Momentum Limited evidence of the momentum effect on 5-minute bars in the SPY

๐—œ๐—ป๐˜๐—ฟ๐—ฎ๐—ฑ๐—ฎ๐˜† ๐— ๐—ผ๐—บ๐—ฒ๐—ป๐˜๐˜‚๐—บ Momentum may be the premier anomaly. But it doesn't seem to scale fractally. Analyzing 5-minute SPY ETF bars shows limited evidence of the momentum effect. More to do including adjusting for overnight returns. Stay tuned!
optionstocksmachines.substack.com/p/intraday-m...

02.04.2025 19:28 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
HFW 10: When average wins An average growth rate forecast model beats the more sophisticated models thus far

๐—›๐—™๐—ช ๐Ÿญ๐Ÿฌ: ๐—ช๐—ต๐—ฒ๐—ป ๐—ฎ๐˜ƒ๐—ฒ๐—ฟ๐—ฎ๐—ด๐—ฒ ๐˜„๐—ถ๐—ป๐˜€ Using historical average growth rate with forward recursion outperforms all previous models, except, original naรฏve benchmark. But try recommending a naรฏve model to stakeholders. Heteroskedasticity models next. Stay tuned!
optionstocksmachines.substack.com/p/hfw-10-whe...

31.03.2025 18:10 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Crypto Regimes Hierarchical clustering generates attractive trading signals in Bitcoin and Ethereum

๐—–๐—ฟ๐˜†๐—ฝ๐˜๐—ผ ๐—ฅ๐—ฒ๐—ด๐—ถ๐—บ๐—ฒ: Revisiting our work on regime detection, we use clustering algorithms on crypto to generate trading signals, producing powerful outperformance. Stay tuned for other regime detection algorithms in upcoming posts.
optionstocksmachines.substack.com/p/crypto-reg...
#python #datascience

28.03.2025 17:35 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
BOTW 6: AAII Redux We build a relatively stable model using market implied reactions to the AAII survey

๐—•๐—ข๐—ง๐—ช ๐Ÿฒ: ๐—”๐—”๐—œ๐—œ ๐—ฅ๐—ฒ๐—ฑ๐˜‚๐˜… Using prediction levels to drive trading signals we develop a strategy that outperforms buy-and-hold on cumulative and risk-adjusted returns. Not bad for a relatively straightforward model. Stay tuned for additional refinements!
optionstocksmachines.substack.com/p/botw-6-aai...

26.03.2025 19:30 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
HFW 9: Growth rate forecasting Setting the stage for volatility clustering

๐—›๐—™๐—ช ๐Ÿต: ๐—š๐—ฟ๐—ผ๐˜„๐˜๐—ต ๐—ฟ๐—ฎ๐˜๐—ฒ ๐—ณ๐—ผ๐—ฟ๐—ฒ๐—ฐ๐—ฎ๐˜€๐˜๐—ถ๐—ป๐—ด Adding growth rate forecasting to toolbox. Provides intuition on ๐˜ด๐˜ต๐˜ข๐˜ต๐˜ช๐˜ฐ๐˜ฏ๐˜ข๐˜ณ๐˜ช๐˜ต๐˜บ, but also motivates examination of next set models that explicitly forecast volatility. Stay tuned!
optionstocksmachines.substack.com/p/hfw-9-grow...
#python #datascience #timeseries

24.03.2025 19:57 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
BOTW 5: Covered call ETFs Nice idea, but they don't perform as well as expected. A long-short portfolio of actively vs. passively managed ETFs looks promising though.

๐—•๐—ข๐—ง๐—ช ๐Ÿฑ: ๐—–๐—ผ๐˜ƒ๐—ฒ๐—ฟ๐—ฒ๐—ฑ ๐—–๐—ฎ๐—น๐—น ๐—˜๐—ง๐—™๐˜€ Perform poorly on a cumulative and risk-adjusted return basis. Long-short active-passive covered call ETF portfolio enjoys substantial risk-adjusted outperformance. Stay tuned as we drill down into this in further posts! optionstocksmachines.substack.com/p/botw-5-cov...

21.03.2025 18:19 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
One Naรฏve Portfolio RSP does not meaningfully outperform SPY

๐—ข๐—ป๐—ฒ ๐—ก๐—ฎรฏ๐˜ƒ๐—ฒ ๐—ฃ๐—ผ๐—ฟ๐˜๐—ณ๐—ผ๐—น๐—ถ๐—ผ Over the long term, equal-weighted RSP performs similar to the SPY for a higher expense ratio. A tactical allocation might be warranted. Need to confirm in a follow-on post. Stay tuned!
optionstocksmachines.substack.com/p/one-naive-...
#python #datascience #workingidea

19.03.2025 17:18 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0