Hi, Shrewd!        Login  
Shrewd'm.com 
A merry & shrewd investing community
Best Of MIBest OfAll BoardsThe Shrewd’m WeeklyLearn to InvestHow to Become Shrewd
Search
Shrewd'm.com Merry shrewd investors
Search
Best Of MIBest OfAll BoardsThe Shrewd’m WeeklyLearn to InvestHow to Become Shrewd


The week's question
In December 2024, in the thread "Re: BRK: Why Not XOM?", BreckHutHigh asked the members: "What about the long road trips with kids?" This week it is put to everyone again. The button below opens the small thread re-asking it - read what others have said so far, then give your own answer as an ordinary reply.
Answer this questionContinue to Shrewd'mThis note won't appear again
Investment Strategies / Mechanical Investing
Unthreaded | Threaded | Whole Thread (19) |
Author: RAMc   😊 😞
Number: of 6131 
Subject: Re: Fidelity's "basket portfolio" featu
Date: 06/18/26 4:49 PM
Post New | Post Reply | Report Post | Recommend It!
No. of Recommendations: 2
What we as mechanical investors need is an optimal stock switching strategy. We have a screen which is stock rating system that each period has determined that there are N held stocks that are less likely to outperform than N new stocks. The algorithm should optimally create a set of sell then buy orders that accomplish this with a minimum slippage. I can’t believe that the brokerages that have this same problem in their internal mutual funds management. Pairs trading sometimes use a rule based on the available shares at a spread and the z-score. I asked Claude for advice on this problem and this was part of the reply:

This is a well-studied problem that touches several areas of quantitative finance. Here's the landscape:
The Core Problem
You're solving a portfolio transition optimization problem — minimizing cost (market impact, spread, timing risk) while moving from portfolio A to portfolio B.

Multi-Leg Execution Algorithms
Brokers and execution systems (e.g., ITG, Virtu, Bloomberg EMSX) solve this as a constrained optimization:
minimize: Σ spread_cost_i + Σ market_impact_i + timing_risk
subject to:
- available_quantity_i at each price level (LOB depth)
- cash-neutrality or delta-neutrality constraints
- position limits
- correlated execution timing across legs
Cross-Impact & Correlation Effects
The hard part for N > 2 is cross-asset market impact — selling stock A moves the price of correlated stock B before you buy it. Research papers by:
• Mastromatteo et al. on cross-impact
• Schneider & Lillo — "Cross-impact and no-dynamic-arbitrage"
These show that naive leg-by-leg execution is suboptimal; you need to jointly optimize the execution schedule.

>>> The point is that all the major brokers know about this problem and most likely are already using internal algorithms for this. And this type of portfolio exchange isn’t just used by mechanical investors. Or perhaps they don’t want to offer a black box system that obviously like any system like this make some poor trades.
Post New | Post Reply | Report Post | Recommend It!
Print the post
Members reply directly to RAMc here — and replies get answered. Reading is free; so is joining the conversation. Join Shrewd'm »
This community has written 6,115 posts about Mechanical Investing. The article-length ones it recommended most:
Dividend investing · 52 recs · 2025
Non-Mag7 screen · 34 recs · 2025
OT - Div yields and returns · 32 recs · 2024
Using AI to generate backtesting programs · 30 recs · 2025
Rankings for 19Dec2022 · 29 recs · 2022
Unthreaded | Threaded | Whole Thread (19) |


Announcements
Mechanical Investing FAQ
Contact Shrewd'm
Contact the developer of these message boards.

Best Of MI | Best Of | Favourites & Replies | All Boards | Followed Shrewds | Open Questions | Moving a community