Shared conversation
Mswing Trading Strategy: Portfolio Creation and Backtesting
A conversation detailing the creation and backtesting of various portfolios based on the Mswing momentum indicator, using top stocks by market cap from 2018, 2020 and 2022, and backtesting from 2019 to present.
Read the conversation below. Open the interactive view for charts, attachments, and continuing this conversation.
User
what are the top 100 stocks by market cap as of 2018?
Aurora
Here's a summary of the top stocks by market capitalization as of December 31, 2018:
Top Stocks by Market Capitalization (December 31, 2018)
| Ticker | Market Cap (USD) | Date |
|---|---|---|
| MSFT | $788,792,620,000 | 2018-12-31 |
| AAPL | $764,652,063,780 | 2018-12-31 |
| AMZN | $752,486,970,000 | 2018-12-31 |
| GOOGL | $735,504,206,431.51 | 2018-12-31 |
| GOOG | $728,923,127,414.00 | 2018-12-31 |
| BRK-B | $503,371,644,366.06 | 2018-12-31 |
| BRK-A | $502,124,274,000 | 2018-12-31 |
| META | $382,618,937,500 | 2018-12-31 |
| JNJ | $351,996,780,000.00 | 2018-12-31 |
| JPM | $331,574,237,220 | 2018-12-31 |
| V | $304,253,640,000 | 2018-12-31 |
| XOM | $291,442,191,798.57 | 2018-12-31 |
| WMT | $273,954,150,000 | 2018-12-31 |
| BAC | $250,608,512,000 | 2018-12-31 |
| PFE | $247,519,160,536 | 2018-12-31 |
| UNH | $244,884,960,000 | 2018-12-31 |
| PG | $240,104,232,000 | 2018-12-31 |
| VZ | $232,750,800,000 | 2018-12-31 |
| WFC | $222,366,584,033.28 | 2018-12-31 |
| INTC | $218,130,640,000 | 2018-12-31 |
| CVX | $208,601,996,460 | 2018-12-31 |
| KO | $203,368,250,000 | 2018-12-31 |
| CSCO | $199,924,620,000 | 2018-12-31 |
| MA | $196,761,952,829.75 | 2018-12-31 |
| HD | $196,046,620,000 | 2018-12-31 |
| MRK | $195,116,211,862 | 2018-12-31 |
| BA | $187,114,500,000 | 2018-12-31 |
| ORCL | $172,680,245,859.45 | 2018-12-31 |
| DIS | $164,255,700,000 | 2018-12-31 |
| T | $157,682,411,160 | 2018-12-31 |
| PEP | $157,323,520,000 | 2018-12-31 |
| CMCSA | $157,276,950,000 | 2018-12-31 |
| ABBV | $139,667,850,000 | 2018-12-31 |
| MCD | $138,433,572,000 | 2018-12-31 |
| C | $129,181,684,000 | 2018-12-31 |
| ABT | $128,168,760,000 | 2018-12-31 |
| AMGN | $126,340,829,999.99 | 2018-12-31 |
| NKE | $121,174,416,000 | 2018-12-31 |
| NFLX | $120,960,639,540.00 | 2018-12-31 |
| LLY | $118,763,436,000 | 2018-12-31 |
| ADBE | $112,410,963,840 | 2018-12-31 |
| AVGO | $107,560,437,711.48 | 2018-12-31 |
| CRM | $107,521,450,000 | 2018-12-31 |
| PM | $103,811,800,000.00 | 2018-12-31 |
| UNP | $102,414,607,000 | 2018-12-31 |
| PYPL | $100,823,910,000 | 2018-12-31 |
| IBM | $99,366,425,100.80 | 2018-12-31 |
| HON | $99,354,240,000 | 2018-12-31 |
| FGEN | $97,775,756,000 | 2018-12-31 |
| MMM | $95,328,542,848 | 2018-12-31 |
| TXN | $93,460,500,000 | 2018-12-31 |
| MO | $93,001,370,000 | 2018-12-31 |
| COST | $90,192,398,790 | 2018-12-31 |
| TMO | $90,092,568,527.78 | 2018-12-31 |
| SBUX | $86,856,280,000.00 | 2018-12-31 |
| NKTR | $85,148,748,900 | 2018-12-31 |
| BMY | $85,039,280,000 | 2018-12-31 |
| UPS | $84,851,100,000 | 2018-12-31 |
| NVDA | $83,437,500,000 | 2018-12-31 |
| NEE | $82,981,668,000 | 2018-12-31 |
| BKNG | $82,247,277,420 | 2018-12-31 |
| AXP | $81,975,200,000 | 2018-12-31 |
| GILD | $81,752,850,000 | 2018-12-31 |
| QCOM | $80,641,470,000 | 2018-12-31 |
| CAT | $76,165,758,000 | 2018-12-31 |
| LMT | $75,069,528,000 | 2018-12-31 |
| USB | $74,628,100,000 | 2018-12-31 |
| LOW | $74,534,520,000 | 2018-12-31 |
| COP | $73,117,470,900 | 2018-12-31 |
| AMT | $70,255,501,464.57 | 2018-12-31 |
| ELV | $69,702,002,000 | 2018-12-31 |
| MS | $68,475,550,000 | 2018-12-31 |
| CVS | $66,961,439,999.99 | 2018-12-31 |
| GS | $65,233,024,331.80 | 2018-12-31 |
| WBA | $65,009,162,000 | 2018-12-31 |
| DHR | $64,952,039,121.20 | 2018-12-31 |
| CME | $64,155,504,200 | 2018-12-31 |
| BLK | $63,647,179,022.40 | 2018-12-31 |
| DUK | $61,618,200,000 | 2018-12-31 |
| BIIB | $60,755,748,000 | 2018-12-31 |
| SYK | $59,596,350,000 | 2018-12-31 |
| MDLZ | $59,244,400,000 | 2018-12-31 |
| TSLA | $59,238,400,890 | 2018-12-31 |
| BDX | $58,982,337,435 | 2018-12-31 |
| DD | $58,620,933,972 | 2018-12-31 |
| ADP | $57,679,688,000 | 2018-12-31 |
| ISRG | $57,087,263,999.99 | 2018-12-31 |
| SCHW | $56,646,920,000 | 2018-12-31 |
| TJX | $56,263,323,880 | 2018-12-31 |
| PNC | $54,596,970,000 | 2018-12-31 |
| TMUS | $54,313,574,318.04 | 2018-12-31 |
| EPD | $53,864,395,000 | 2018-12-31 |
| CSX | $53,059,020,000 | 2018-12-31 |
| KHC | $52,767,040,000 | 2018-12-31 |
| INTU | $51,968,400,000 | 2018-12-31 |
| SPG | $51,958,299,060 | 2018-12-31 |
| CL | $51,847,872,000 | 2018-12-31 |
| EOG | $50,717,760,390 | 2018-12-31 |
| SLB | $50,223,360,000 | 2018-12-31 |
| BSX | $49,613,826,000.00 | 2018-12-31 |
Summary of Results
This data presents a snapshot of the top companies by market capitalization at the close of 2018. The list is dominated by major technology companies like Microsoft, Apple, Amazon, and Alphabet (Google), reflecting their significant market presence even several years ago. Traditional industry giants such as Berkshire Hathaway, Johnson & Johnson, and JPMorgan Chase also feature prominently, indicating a diverse landscape of leading companies across various sectors.
Interesting Observations
- Tech Dominance: The top five positions are held by technology companies (MSFT, AAPL, AMZN, GOOGL, GOOG), underscoring the tech sector's strong influence on the market even in 2018.
- Berkshire Hathaway's Dual Listing: Both Class A (BRK-A) and Class B (BRK-B) shares of Berkshire Hathaway are listed, reflecting their distinct market capitalizations.
- Historical Context: This data provides a valuable historical perspective on market leaders. It's interesting to note how some companies, like NVIDIA (NVDA), had a significantly smaller market cap in 2018 ($83.44 billion) compared to their current valuations, highlighting their immense growth in subsequent years. Tesla (TSLA) also appears on the list with a market cap of $59.24 billion, which is a fraction of its current size.
Pros
- Clear Snapshot: Provides a clear, ordered list of the largest companies by market capitalization on a specific date.
- Historical Insight: Useful for understanding market trends and the relative size of companies in 2018.
Cons
- Outdated Data: The primary limitation is that the data is from December 31, 2018. Market capitalizations and company rankings have changed significantly since then, making this data unsuitable for current investment decisions.
- Limited Scope: Only includes market capitalization, without other fundamental or technical metrics that would be necessary for a comprehensive financial analysis.
Important Note
Please remember to double-check all financial data and observations generated by AI. While I strive for accuracy, I can make mistakes, and it's always best to verify information from reliable, current sources before making any financial decisions. This historical data should not be used for current investment analysis.
User
Meet Mswing: The Trading Tool That Does It All
Algo Insights
Algo Insights
5 min read
·
Mar 26, 2025
Ever wished for one indicator that could cut through the noise and just tell you what’s up with a stock? Say hello to Mswing — a little gem inspired by Sakata Homma, the Japanese trading legend who probably forgot more about markets than we’ll ever know. They call it the “one indicator to rule them all,” and honestly, it’s not hype. It’s a momentum tracker, a strength gauge, a signal machine, and even a market mood ring. Let’s unpack it step by step.
Press enter or click to view image in full size
So, What’s Mswing Anyway?
Mswing is like a speedometer for stock prices. It looks at how fast a stock’s moving over 20 and 50 days — two windows that give you the short and long of it. Simple rule: if it’s above zero, the stock’s got some upward juice. Below zero? It’s slumping.
But here’s where it gets fun. Slap an EMA — exponential moving average, for the uninitiated — on top of Mswing, and you’ve got a cheat sheet for momentum. I break it down like this:
Mswing’s above zero and above its EMA: The stock’s not just climbing — it’s picking up speed. Green light, baby.
Above zero but below EMA: It’s still going up, but the engine’s sputtering. Maybe keep an eye on it.
Below zero but above EMA: Things are grim, but there’s a flicker of hope — like a stock trying to claw its way back.
Below zero and below EMA: Downtrend city. Might be time to bail.
Load that up, tweak it if you’re feeling fancy, and watch the lines dance.
Re-import necessary libraries after execution state reset
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
Generate synthetic closing price data
np.random.seed(42)
closing_prices = np.cumsum(np.random.randn(100) * 2 + 100) # Simulated price data
Define the Mswing Indicator calculation
length1, length2 = 20, 50
Ensure enough data points exist before calculating Mswing
mswing = np.zeros(len(closing_prices))
for i in range(len(closing_prices)):
if i >= length2:
mswing[i] = ((closing_prices[i] - closing_prices[i - length1]) / closing_prices[i - length1] * 100) +
((closing_prices[i] - closing_prices[i - length2]) / closing_prices[i - length2] * 100)
else:
mswing[i] = np.nan # Not enough data
Calculate the EMA of Mswing (similar to Pine Script's ta.ema)
def ema(series, span):
return pd.Series(series).ewm(span=span, adjust=False).mean().to_numpy()
ema_mswing = ema(mswing, 9)
Create the plot
plt.figure(figsize=(12, 6))
plt.plot(mswing, label="Mswing", color="blue", linestyle="-", alpha=0.7)
plt.plot(ema_mswing, label="EMA of Mswing", color="orange", linestyle="-", alpha=0.9)
plt.axhline(0, color="gray", linestyle="dashed", label="Zero Line")
Labels and title
plt.title("Mswing Indicator with EMA", fontsize=14)
plt.xlabel("Index", fontsize=12)
plt.ylabel("Mswing Value", fontsize=12)
plt.legend()
plt.grid(True)
Show the plot
plt.show()
Press enter or click to view image in full size
How Strong Is That Momentum?
Mswing doesn’t just say “up” or “down” — it tells you how much. The bigger the number, the harder the stock’s running. I like to think of it as a leaderboard. Grab a bunch of stocks, sort them by Mswing, and boom — you’ve got your winners and losers. A stock at 3.8 is smoking one at 0.5, no contest.
Relative Strength: Who’s Beating the Pack?
Here’s where Mswing flexes. Compare a stock’s Mswing to, say, the NSE 500 index. If the stock’s score beats the index, it’s got swagger. If not, it’s dragging its feet. They even color-code it for us visual folks:
Green (🟢): Killing it — absolute beast mode.
Orange (🟠): Doing okay — better than average, but not a superstar.
Another Orange (🟠): Slacking — underperforming, but not a total disaster.
Red (🔴): Oof, absolute dud.
Swap index_close for something like close(“NSEI”). If that purple line’s above zero, your stock’s got bragging rights.
When to Jump In, When to Bail
Mswing’s not just a pretty chart — it’s a playbook. Here’s how I use it:
Getting In
Mswing crosses above zero: Especially after a long snooze, it’s like the stock’s finally waking up.
Breaks out of a tight range: Momentum’s brewing — could be go-time.
Mswing tops its EMA and price cracks a big moving average: Double whammy. I’d eyeball the 50-day SMA here.
Getting Out
Sell high: Mswing hits 4 or more? Overbought territory — grab your profits and run.
Cut losses: Mswing’s below zero and price dips under the 50-day SMA? Don’t stick around for the funeral.
Generate synthetic stock and index closing prices
np.random.seed(42)
stock_prices = np.cumsum(np.random.randn(100) * 2 + 100) # Simulated stock price data
index_prices = np.cumsum(np.random.randn(100) * 1.5 + 100) # Simulated index price data
Define Mswing calculation function
def calculate_mswing(prices, length1, length2):
mswing = np.zeros(len(prices))
for i in range(len(prices)):
if i >= length2:
mswing[i] = ((prices[i] - prices[i - length1]) / prices[i - length1] * 100) +
((prices[i] - prices[i - length2]) / prices[i - length2] * 100)
else:
mswing[i] = np.nan # Not enough data
return mswing
Calculate Mswing for stock and index
length1, length2 = 20, 50
mswing_stock = calculate_mswing(stock_prices, length1, length2)
mswing_index = calculate_mswing(index_prices, length1, length2)
Calculate Relative Strength
relative_strength = mswing_stock - mswing_index
Create the plot
plt.figure(figsize=(12, 6))
plt.plot(relative_strength, label="Relative Strength", color="purple", linestyle="-", alpha=0.9)
plt.axhline(0, color="gray", linestyle="dashed", label="Zero Line")
Labels and title
plt.title("Mswing with Relative Strength", fontsize=14)
plt.xlabel("Index", fontsize=12)
plt.ylabel("Relative Strength Value", fontsize=12)
plt.legend()
plt.grid(True)
Show the plot
plt.show()
Press enter or click to view image in full size
Market Breadth: The Big Picture
Here’s a trick I love: use Mswing to check the market’s pulse. Take a chunk of stocks — like the NSE 500 — and see how many have Mswing above zero. That’s your breadth. My rough guide:
Over 80%: Everyone’s partying — might be time to cash out before the crash.
Under 20%: Everything’s trashed — could be a bargain-hunting zone.
If it’s sky-high or dirt-low, you’ll know what’s up.
Tools to Mess With
TradingView: Drop that script in and tinker.
Chartink: Build a scanner — sort stocks or track breadth.
Video: There’s a killer explainer out there (imagine I linked it — go hunt one down!).
Why I Dig Mswing
After a decade of staring at charts, I’ve seen indicators come and go. Mswing sticks because it’s like a buddy who’s always got something useful to say — whether it’s momentum, strength, or just “hey, get out now.” Start small, test it on a stock you love, and see where it takes you.
Disclaimer: For educational purposes only: If you’re seeking a fully developed, ready-to-use trading system, this article won’t fulfill that expectation. However, if you’re interested in exploring ideas for further development, you’ll find valuable insights here.
I attached a different portfolio with a rebalancing strategy and a filter. I also attached an article about Mswing. Create two new portfolios using the "Mswing" rebalance filter. Include the limit, the weighting by market cap, and the position filter, but change the rest of the filters to correspond to the Mswing strategy. Each portfolio should intrepret the Mswing strategy from the article. Also use the list of stocks from 2018. Exclude GOOGL and BRK-A (because we have GOOG and BRK-B)
"_id": "689d03129721b27f93d191a2",
"name": "2022 Top 100 Market Cap Rebalance - SMA & Position Gain Filter",
"initialValue": 10000,
"buyingPower": 53.74501524203015,
"strategies": [
{
"_id": "689d03129721b27f93d191a1",
"__v": 0,
"action": {
"type": "Rebalance",
"limit": 7,
"sortDirection": "Descending",
"assets": [
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "AAPL",
"type": "Stock",
"symbol": "AAPL"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "AAPL's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "AAPL",
"type": "Stock",
"symbol": "AAPL"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "MSFT",
"type": "Stock",
"symbol": "MSFT"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "MSFT's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "MSFT",
"type": "Stock",
"symbol": "MSFT"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "GOOGL",
"type": "Stock",
"symbol": "GOOGL"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "GOOGL's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "GOOGL",
"type": "Stock",
"symbol": "GOOGL"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "AMZN",
"type": "Stock",
"symbol": "AMZN"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "AMZN's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "AMZN",
"type": "Stock",
"symbol": "AMZN"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "BRK-B",
"type": "Stock",
"symbol": "BRK-B"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "BRK-B's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "BRK-B",
"type": "Stock",
"symbol": "BRK-B"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "UNH",
"type": "Stock",
"symbol": "UNH"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "UNH's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "UNH",
"type": "Stock",
"symbol": "UNH"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "DFLI",
"type": "Stock",
"symbol": "DFLI"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "DFLI's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "DFLI",
"type": "Stock",
"symbol": "DFLI"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "JNJ",
"type": "Stock",
"symbol": "JNJ"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "JNJ's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "JNJ",
"type": "Stock",
"symbol": "JNJ"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "XOM",
"type": "Stock",
"symbol": "XOM"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "XOM's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "XOM",
"type": "Stock",
"symbol": "XOM"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "V",
"type": "Stock",
"symbol": "V"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "V's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "V",
"type": "Stock",
"symbol": "V"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "TSLA",
"type": "Stock",
"symbol": "TSLA"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "TSLA's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "TSLA",
"type": "Stock",
"symbol": "TSLA"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "ACON",
"type": "Stock",
"symbol": "ACON"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "ACON's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "ACON",
"type": "Stock",
"symbol": "ACON"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "JPM",
"type": "Stock",
"symbol": "JPM"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "JPM's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "JPM",
"type": "Stock",
"symbol": "JPM"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "TSM",
"type": "Stock",
"symbol": "TSM"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "TSM's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "TSM",
"type": "Stock",
"symbol": "TSM"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "WMT",
"type": "Stock",
"symbol": "WMT"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "WMT's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "WMT",
"type": "Stock",
"symbol": "WMT"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "PG",
"type": "Stock",
"symbol": "PG"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "PG's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "PG",
"type": "Stock",
"symbol": "PG"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "NVDA",
"type": "Stock",
"symbol": "NVDA"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "NVDA's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "NVDA",
"type": "Stock",
"symbol": "NVDA"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "CVX",
"type": "Stock",
"symbol": "CVX"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "CVX's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name": "CVX",
"type": "Stock",
"symbol": "CVX"
}
}
},
{
"indicator": {
"timePassed": 0,
"compound": false,
"targetAsset": {
"name": "MA",
"type": "Stock",
"symbol": "MA"
},
"targetAssets": [],
"type": "Fundamental",
"metric": "marketCap",
"name": "MA's marketCap"
},
"asset": {
"type": "asset",
"asset": {
"name
Message shortened in this preview.
Aurora
Description:
Based on the provided article, we've created two distinct portfolios that utilize the "Mswing" momentum indicator. Both portfolios trade the top 100 stocks by market cap from the end of 2018 (excluding GOOGL and BRK-A), rebalance monthly, and are limited to holding the top 7 qualifying stocks, weighted by market capitalization. Each portfolio interprets the Mswing indicator in a unique way to capture momentum.
The Mswing indicator is defined as the sum of the 20-day Price Rate of Change and the 50-day Price Rate of Change: Mswing = PriceRateOfChange(asset, 20) + PriceRateOfChange(asset, 50).
- Mswing "Green Light" Momentum Portfolio: This strategy is based on the article's "Green light, baby" condition, which identifies stocks with strong and accelerating upward momentum. It filters for stocks where the Mswing indicator is not only positive (above zero) but also trading above its own 9-day Exponential Moving Average (EMA). This dual condition ensures the portfolio selects stocks that are in a confirmed uptrend and are gaining strength.
- Mswing "Breakout" Portfolio: This strategy interprets the "Getting In" section of the article, focusing on breakout signals. It filters for stocks where the Mswing indicator has crossed above its 9-day EMA, signaling a positive shift in momentum, and where the stock's current price is above its 50-day Simple Moving Average (SMA). This combination aims to capture stocks that are breaking out from a base and have strong underlying momentum to support the move.
Both strategies also include a position-keeping filter from the provided example, which allows a stock to remain in the portfolio if it's already held (PositionValue > 0) and hasn't fallen more than 10% (PositionPercentChange < 10), even if it no longer meets the primary Mswing criteria. This helps reduce unnecessary turnover.
JSON:
User
Create two more which excludes the position filter and implements MSwing as stated in the original article
Aurora
Description:
Here are two new portfolios based on the Mswing momentum indicator, as described in the article. Both strategies use the list of top stocks from 2018 (excluding GOOGL and BRK-A) and rebalance monthly to invest in the top 7 qualifying stocks, weighted by market capitalization. Crucially, these versions remove the previous position-keeping filter, adhering strictly to the Mswing entry signals for each rebalance.
The Mswing indicator is calculated as the sum of the 20-day and 50-day price rates of change: Mswing = PriceRateOfChange(asset, 20) + PriceRateOfChange(asset, 50).
- Mswing "Green Light" Strategy (Pure Signal): This portfolio implements the core "Green light, baby" condition from the article. It selects stocks that are exhibiting strong, accelerating momentum by filtering for companies where the Mswing indicator is both above zero and also above its own 9-day Exponential Moving Average (EMA). This ensures the portfolio only holds stocks in a confirmed and strengthening uptrend, without retaining any positions that fall out of favor.
- Mswing "Breakout" Strategy (Pure Signal): This portfolio focuses on the "double whammy" breakout signal mentioned in the article. It identifies stocks at a potential entry point by filtering for companies where the Mswing indicator has crossed above its 9-day EMA (signaling a positive momentum shift) AND the stock's price is trading above its 50-day Simple Moving Average (SMA). This combination targets stocks that are clearing key technical levels with strong momentum behind them.
JSON:
User
Backtest all 4 portfolios from 01/01/2019 to 01/01/2021
Aurora
I'll create a backtest configuration for the four Mswing-based portfolios you've defined, covering the period from January 1, 2019, to January 1, 2021.
Here's the JSON configuration:
User
Backtest all 4 portfolios from 01/01/2020 to 01/01/2022
Aurora
I'll create a backtest configuration for all four of your Mswing-based portfolios, covering the period from January 1, 2020, to January 1, 2022.
User
what are the top 100 stocks by market cap as of 2020?
Aurora
Here is a summary of the top stocks by market capitalization as of the end of 2020.
Top Stocks by Market Capitalization (December 31, 2020)
| Ticker | Market Cap (USD) | Date |
|---|---|---|
| AAPL | $2,289,767,771,490 | 2020-12-31 |
| MSFT | $1,698,621,540,000 | 2020-12-31 |
| AMZN | $1,667,548,160,000 | 2020-12-31 |
| GOOGL | $1,202,049,415,803 | 2020-12-31 |
| GOOG | $1,201,528,169,252 | 2020-12-31 |
| META | $789,705,560,000 | 2020-12-31 |
| TSLA | $779,765,338,950 | 2020-12-31 |
| BABA | $640,618,416,250 | 2020-12-31 |
| TSM | $565,489,736,963 | 2020-12-31 |
| BRK-B | $551,861,266,020 | 2020-12-31 |
| BRK-A | $537,013,490,845 | 2020-12-31 |
| V | $482,955,840,000 | 2020-12-31 |
| JNJ | $420,094,434,000 | 2020-12-31 |
| WMT | $410,683,350,000 | 2020-12-31 |
| JPM | $392,306,896,030 | 2020-12-31 |
| PG | $365,284,242,000 | 2020-12-31 |
| MA | $358,724,700,000 | 2020-12-31 |
| UNH | $337,354,160,000 | 2020-12-31 |
| NVDA | $328,986,000,000 | 2020-12-31 |
| DIS | $327,754,620,000 | 2020-12-31 |
| HD | $286,338,360,000 | 2020-12-31 |
| PYPL | $278,698,000,000 | 2020-12-31 |
| BAC | $266,046,025,000 | 2020-12-31 |
| NFLX | $246,079,734,240 | 2020-12-31 |
| VZ | $243,342,500,000 | 2020-12-31 |
| ADBE | $242,558,200,000 | 2020-12-31 |
| CMCSA | $242,507,200,000 | 2020-12-31 |
| KO | $236,963,640,000 | 2020-12-31 |
| NKE | $225,404,151,000 | 2020-12-31 |
| INTC | $209,792,020,000 | 2020-12-31 |
| CRM | $208,955,670,000 | 2020-12-31 |
| PFE | $207,350,730,000 | 2020-12-31 |
| PEP | $206,137,000,000 | 2020-12-31 |
| ASML | $204,062,048,000 | 2020-12-31 |
| MRK | $197,960,025,492 | 2020-12-31 |
| ORCL | $197,466,225,000 | 2020-12-31 |
| ABT | $195,768,120,000 | 2020-12-31 |
| ABBV | $190,084,100,000 | 2020-12-31 |
| CSCO | $189,919,000,000 | 2020-12-31 |
| AVGO | $186,991,574,931 | 2020-12-31 |
| XOM | $186,863,999,986 | 2020-12-31 |
| TMO | $185,846,220,000 | 2020-12-31 |
| QCOM | $174,886,320,000 | 2020-12-31 |
| TMUS | $168,535,360,089 | 2020-12-31 |
| COST | $167,435,757,080 | 2020-12-31 |
| NVO | $162,488,497,295 | 2020-12-31 |
| LLY | $161,493,940,440 | 2020-12-31 |
| MCD | $160,935,000,000 | 2020-12-31 |
| CVX | $156,530,861,850 | 2020-12-31 |
| T | $155,706,921,972 | 2020-12-31 |
| TXN | $152,476,770,000 | 2020-12-31 |
| NEE | $151,142,568,667 | 2020-12-31 |
| HON | $150,931,920,000 | 2020-12-31 |
| UPS | $146,844,800,000 | 2020-12-31 |
| DHR | $142,616,553,180 | 2020-12-31 |
| BMY | $142,048,700,000 | 2020-12-31 |
| UNP | $140,923,296,000 | 2020-12-31 |
| JD | $140,251,438,050 | 2020-12-31 |
| AMGN | $135,422,880,000 | 2020-12-31 |
| C | $129,134,538,000 | 2020-12-31 |
| PM | $128,986,820,000 | 2020-12-31 |
| SBUX | $126,129,420,000 | 2020-12-31 |
| WFC | $124,709,796,000 | 2020-12-31 |
| BA | $121,661,949,286 | 2020-12-31 |
| LOW | $121,024,540,000 | 2020-12-31 |
| AMD | $111,427,650,000 | 2020-12-31 |
| BLK | $111,376,698,660 | 2020-12-31 |
| NOW | $111,110,350,230 | 2020-12-31 |
| IBM | $107,886,830,722 | 2020-12-31 |
| MS | $107,317,980,000 | 2020-12-31 |
| XYZ | $106,223,337,160 | 2020-12-31 |
| ZM | $100,945,966,610 | 2020-12-31 |
| INTU | $100,660,250,000 | 2020-12-31 |
| AMT | $100,144,176,433 | 2020-12-31 |
| LMT | $99,607,388,000 | 2020-12-31 |
| CAT | $99,455,728,000 | 2020-12-31 |
| ISRG | $98,662,860,000 | 2020-12-31 |
| SE | $98,490,953,165 | 2020-12-31 |
| EL | $97,744,968,000 | 2020-12-31 |
| AXP | $97,332,550,000 | 2020-12-31 |
| GS | $94,909,227,945 | 2020-12-31 |
| SYK | $93,164,208,000 | 2020-12-31 |
| BKNG | $91,498,478,870 | 2020-12-31 |
| CVS | $89,814,500,000 | 2020-12-31 |
| UBER | $89,506,479,000 | 2020-12-31 |
| TGT | $89,218,262,000 | 2020-12-31 |
| FIS | $88,695,420,000 | 2020-12-31 |
| FGEN | $86,862,925,500 | 2020-12-31 |
| ABNB | $86,200,814,228 | 2020-12-31 |
| DE | $85,315,755,000 | 2020-12-31 |
| MMM | $85,110,503,296 | 2020-12-31 |
| MU | $85,028,580,000 | 2020-12-31 |
| MDLZ | $84,313,740,000 | 2020-12-31 |
| TJX | $82,917,376,550 | 2020-12-31 |
| ELV | $81,621,078,000 | 2020-12-31 |
| AMAT | $79,482,300,000 | 2020-12-31 |
| SPGI | $79,421,168,000 | 2020-12-31 |
| ZTS | $79,191,750,000 | 2020-12-31 |
| SNOW | $78,448,174,787 | 2020-12-31 |
| FI | $77,458,958,000 | 2020-12-31 |
Summary and Observations
This list provides a snapshot of the world's largest public companies by market capitalization at the end of 2020. The data clearly shows the continued dominance of the technology sector, with significant growth in several key names compared to previous years.
Pros:
- Historical Benchmark: The data serves as an excellent historical reference for the market landscape at the close of 2020.
- Sector Trends: It clearly illustrates the powerful trend of technology and growth stocks leading the market during that period.
Cons:
- Outdated Information: This data is from over four years ago and should not be used for current investment decisions, as market capitalizations and rankings have changed dramatically.
- Limited Metrics: The list is based solely on market capitalization and does not include other vital financial metrics like revenue, earnings, or valuation ratios.
Interesting Observations:
- Apple's Milestone: AAPL solidified its position as the most valuable company, with a market cap exceeding $2.2 trillion.
- Tesla's Explosive Growth: TSLA experienced a monumental year, catapulting its market cap to nearly $780 billion and placing it among the top 10 largest companies. This is a massive increase from its $59 billion valuation at the end of 2018.
- Pandemic Impact: The rise of companies like ZM (Zoom) and the continued strength of NFLX (Netflix) highlight the economic shifts driven by the COVID-19 pandemic.
- New Entrants: The list includes several companies that went public or saw rapid growth in 2020, such as SNOW (Snowflake) and ABNB (Airbnb).
Important Note
Please remember that this analysis is generated by an AI and is based on historical data. Always verify financial information from multiple reliable sources and consult with a qualified financial advisor before making any investment decisions.
User
Recreate the "Mswing Breakout Strategy" and the "Mswing Breakout Strategy (Pure Signal) " using the updated list of stocks
Aurora
Description:
Here are the two "Mswing Breakout" portfolios, recreated using the updated list of the top 100 stocks by market cap from the end of 2020. Both strategies maintain their original logic, rebalancing monthly to hold the top 7 qualifying stocks, weighted by their market capitalization. The core of the Mswing indicator remains the same, defined as the sum of the 20-day and 50-day price rates of change: Mswing = PriceRateOfChange(asset, 20) + PriceRateOfChange(asset, 50).
- Mswing Breakout Strategy (2020 Stocks): This portfolio uses the combined filter. It selects stocks for rebalancing if they meet the primary breakout criteria: the Mswing indicator is above its 9-day EMA, and the stock's price is above its 50-day SMA. Additionally, it includes the position-keeping filter, which allows a stock to remain in the portfolio if it's already held (
PositionValue > 0) and has not incurred a loss of 10% or more (PositionPercentChange > -10), even if it no longer meets the primary breakout signal. This helps to reduce portfolio turnover. - Mswing Breakout Strategy (Pure Signal, 2020 Stocks): This portfolio adheres strictly to the breakout signal from the article, without the position-keeping filter. It will only invest in stocks that meet the dual condition at the time of rebalancing: the Mswing indicator must be above its 9-day EMA, and the price must be above its 50-day SMA. This "pure signal" approach ensures the portfolio is always positioned in stocks that are actively demonstrating strong technical breakouts.
The full list of stocks used for these strategies includes: AAPL, MSFT, AMZN, GOOG, META, TSLA, BABA, TSM, BRK-B, V, JNJ, WMT, JPM, PG, MA, UNH, NVDA, DIS, HD, PYPL, BAC, NFLX, VZ, ADBE, CMCSA, KO, NKE, INTC, CRM, PFE, PEP, ASML, MRK, ORCL, ABT, ABBV, CSCO, AVGO, XOM, TMO, QCOM, TMUS, COST, NVO, LLY, MCD, CVX, T, TXN, NEE, HON, UPS, DHR, BMY, UNP, JD, AMGN, C, PM, SBUX, WFC, BA, LOW, AMD, BLK, NOW, IBM, MS, XYZ, ZM, INTU, AMT, LMT, CAT, ISRG, SE, EL, AXP, GS, SYK, BKNG, CVS, UBER, TGT, FIS, FGEN, ABNB, DE, MMM, MU, MDLZ, TJX, ELV, AMAT, SPGI, ZTS, SNOW, and FI.
JSON:
User
Backtest these 2 portfolios from 01/01/2020 to 01/01/2022
Aurora
Of course. I'll set up a backtest for the "Mswing Breakout Strategy (2020 Stocks)" and "Mswing Breakout Strategy (Pure Signal, 2020 Stocks)" portfolios to run from January 1, 2020, to January 1, 2022.
User
Backtest these 2 portfolios from 01/01/2021 to 01/01/2023
Aurora
Of course. I'll set up a backtest for your two Mswing portfolios using the 2020 stock list, running from January 1, 2021, to January 1, 2023.
User
what are the top 100 stocks by market cap as of 2022?
Aurora
Of course. Here is a summary of the top 100 stocks by market capitalization as of December 30, 2022, the last trading day of that year.
Top Stocks by Market Capitalization (December 30, 2022)
| Ticker | Market Cap (USD) | Date |
|---|---|---|
| AAPL | $2,094,272,157,450 | 2022-12-30 |
| MSFT | $1,795,052,700,000 | 2022-12-30 |
| GOOG | $1,162,096,810,000 | 2022-12-30 |
| GOOGL | $1,155,548,310,000 | 2022-12-30 |
| AMZN | $856,632,000,000 | 2022-12-30 |
| BRK-A | $684,192,855,774 | 2022-12-30 |
| BRK-B | $681,391,512,233 | 2022-12-30 |
| UNH | $502,610,640,000 | 2022-12-30 |
| DFLI | $480,329,427,060 | 2022-12-30 |
| JNJ | $470,118,645,000 | 2022-12-30 |
| XOM | $463,354,273,520 | 2022-12-30 |
| V | $439,620,160,000 | 2022-12-30 |
| TSLA | $427,188,240,000 | 2022-12-30 |
| ACON | $410,324,760,720 | 2022-12-30 |
| JPM | $397,660,140,000 | 2022-12-30 |
| TSM | $386,292,700,170 | 2022-12-30 |
| WMT | $384,392,687,289 | 2022-12-30 |
| PG | $379,445,616,000 | 2022-12-30 |
| NVDA | $365,203,860,000 | 2022-12-30 |
| CVX | $348,210,958,980 | 2022-12-30 |
| MA | $336,602,640,000 | 2022-12-30 |
| LLY | $330,646,192,000 | 2022-12-30 |
| META | $323,353,580,000 | 2022-12-30 |
| HD | $323,124,780,000 | 2022-12-30 |
| NSRGY | $309,709,526,250 | 2022-12-30 |
| NVO | $307,018,790,000 | 2022-12-30 |
| PFE | $292,990,320,000 | 2022-12-30 |
| ABBV | $287,019,360,000 | 2022-12-30 |
| MRK | $282,034,900,000 | 2022-12-30 |
| KO | $276,449,060,000 | 2022-12-30 |
| BAC | $270,285,700,000 | 2022-12-30 |
| PEP | $250,575,420,000 | 2022-12-30 |
| AVGO | $239,866,770,000 | 2022-12-30 |
| BNZI | $232,760,000,000 | 2022-12-30 |
| BABA | $230,267,260,000 | 2022-12-30 |
| ORCL | $224,458,040,000 | 2022-12-30 |
| TMO | $217,522,550,000 | 2022-12-30 |
| ASML | $216,702,240,000 | 2022-12-30 |
| SHEL | $209,043,517,500 | 2022-12-30 |
| COST | $202,928,401,500 | 2022-12-30 |
| CSCO | $196,086,240,000 | 2022-12-30 |
| MCD | $194,880,435,000 | 2022-12-30 |
| ABT | $193,669,560,000 | 2022-12-30 |
| NKE | $185,554,458,000 | 2022-12-30 |
| TMUS | $176,289,437,940 | 2022-12-30 |
| DHR | $173,484,809,196 | 2022-12-30 |
| VZ | $165,637,600,000 | 2022-12-30 |
| NEE | $165,436,040,000 | 2022-12-30 |
| DIS | $158,642,880,000 | 2022-12-30 |
| WFC | $157,938,379,000 | 2022-12-30 |
| ADBE | $157,832,570,000 | 2022-12-30 |
| SCHW | $157,777,700,000 | 2022-12-30 |
| PM | $157,077,920,000 | 2022-12-30 |
| BMY | $154,548,600,000 | 2022-12-30 |
| CMCSA | $153,063,690,000 | 2022-12-30 |
| TXN | $152,498,060,000 | 2022-12-30 |
| UPS | $151,588,480,000 | 2022-12-30 |
| COP | $149,779,878,000 | 2022-12-30 |
| HON | $145,638,280,000 | 2022-12-30 |
| MS | $144,278,940,000 | 2022-12-30 |
| AMGN | $141,300,320,000 | 2022-12-30 |
| T | $140,781,270,000 | 2022-12-30 |
| NFLX | $132,797,438,720 | 2022-12-30 |
| CRM | $132,590,000,000 | 2022-12-30 |
| DE | $129,528,396,000 | 2022-12-30 |
| LMT | $128,968,499,000 | 2022-12-30 |
| UNP | $128,694,005,000 | 2022-12-30 |
| IBM | $127,378,649,000 | 2022-12-30 |
| CAT | $126,391,856,000 | 2022-12-30 |
| QCOM | $124,342,140,000 | 2022-12-30 |
| ELV | $124,241,334,000 | 2022-12-30 |
| LOW | $123,528,800,000 | 2022-12-30 |
| GS | $123,342,094,626 | 2022-12-30 |
| CVS | $122,544,850,000 | 2022-12-30 |
| SBUX | $114,328,000,000 | 2022-12-30 |
| BA | $113,589,187,000 | 2022-12-30 |
| SPGI | $110,831,646,000 | 2022-12-30 |
| AXP | $110,664,750,000 | 2022-12-30 |
| INTU | $110,538,480,000 | 2022-12-30 |
| INTC | $109,023,750,000 | 2022-12-30 |
| GILD | $108,256,850,000 | 2022-12-30 |
| BLK | $108,116,865,347 | 2022-12-30 |
| AMD | $105,251,250,000 | 2022-12-30 |
| ADP | $99,580,734,000 | 2022-12-30 |
| AMT | $98,896,460,496 | 2022-12-30 |
| ISRG | $95,658,675,000 | 2022-12-30 |
| SONY | $94,854,561,400 | 2022-12-30 |
| SYK | $93,346,282,000 | 2022-12-30 |
| TJX | $93,312,453,200 | 2022-12-30 |
| MDLZ | $91,910,350,000 | 2022-12-30 |
| EL | $89,666,954,000 | 2022-12-30 |
| JD | $89,274,765,000 | 2022-12-30 |
| C | $88,429,173,000 | 2022-12-30 |
| PLD | $86,393,115,560 | 2022-12-30 |
| NOC | $84,733,233,000 | 2022-12-30 |
| ADI | $84,599,620,710 | 2022-12-30 |
| AMAT | $83,649,420,000 | 2022-12-30 |
| MMC | $83,236,440,000 | 2022-12-30 |
| PYPL | $82,401,540,000 | 2022-12-30 |
| MO | $82,232,290,000 | 2022-12-30 |
Summary and Observations
This data provides a snapshot of the market leaders at the end of 2022, a challenging year for equities marked by high inflation and rising interest rates. The list reflects a broad market downturn, especially in technology and growth sectors, when compared to previous years.
Pros:
- Valuable Historical Data: This list is a precise record of the largest companies at the end of the 2022 bear market, useful for historical analysis.
- Highlights Sector Rotation: The data clearly shows a shift in market leadership. While mega-cap tech still dominates the top spots, their valuations saw significant compression. Conversely, sectors like Energy (XOM, CVX) and Healthcare (UNH, LLY) showed relative strength and moved up the ranks.
Cons:
- Not for Current Decisions: This is a look back at historical data. Market capitalizations have shifted significantly since December 2022, so this list should not be used for making current investment choices.
- Single Metric View: Market cap is just one measure of a company's size and does not reflect its fundamental health, profitability, or valuation.
Interesting and Unusual Observations:
- Tech Valuation Reset: Compared to the 2020 list, the market caps of top tech companies are noticeably lower. For example, AAPL is down from ~$2.3T to ~$2.1T, and AMZN fell from ~$1.7T to ~$857B. META saw a particularly sharp decline from ~$790B to ~$323B.
- Energy's Ascent: XOM climbed dramatically into the top 10, reflecting the surge in energy prices during 2022.
- Data Anomalies: The list includes several unfamiliar tickers like DFLI, ACON, and BNZI with very high market capitalizations. These appear to be data errors, as they are not typically ranked among the largest global companies.
Important Note
Please remember, this analysis is generated by an AI based on historical data and may contain inaccuracies. It is not financial advice. Always conduct your own thorough research and consult with a qualified financial professional before making any investment decisions.
User
Recreate the "Mswing Breakout Strategy" and the "Mswing Breakout Strategy (Pure Signal) " using the updated list of stocks
Aurora
Description:
Here are the two "Mswing Breakout" portfolios, updated to use the list of the top 100 stocks by market capitalization from the end of 2022. Both strategies maintain their original logic, rebalancing monthly to invest in the top 7 qualifying stocks, weighted by market capitalization. The Mswing indicator is defined as the sum of the 20-day and 50-day price rates of change: Mswing = PriceRateOfChange(asset, 20) + PriceRateOfChange(asset, 50).
- Mswing Breakout Strategy (2022 Stocks): This portfolio uses the combined filter. It selects stocks that meet the primary breakout criteria (Mswing > 9-day EMA of Mswing AND Price > 50-day SMA). It also includes a position-keeping rule, allowing a stock to be held if it's already in the portfolio (
PositionValue > 0) and hasn't dropped by 10% or more (PositionPercentChange > -10), which helps to reduce unnecessary trades. - Mswing Breakout Strategy (Pure Signal, 2022 Stocks): This portfolio adheres strictly to the breakout signal. It will only invest in stocks that meet the dual condition at the time of rebalancing: the Mswing indicator must be above its 9-day EMA, and the price must be above its 50-day SMA. This "pure signal" approach ensures the portfolio is always positioned in stocks that are actively demonstrating strong technical breakouts, without any exceptions for existing positions.
For clarity, the full list of stocks used for these strategies (excluding duplicates and data anomalies like DFLI, ACON, BNZI) includes: AAPL, MSFT, GOOG, AMZN, BRK-B, UNH, JNJ, XOM, V, TSLA, JPM, TSM, WMT, PG, NVDA, CVX, MA, LLY, META, HD, NSRGY, NVO, PFE, ABBV, MRK, KO, BAC, PEP, AVGO, BABA, ORCL, TMO, ASML, SHEL, COST, CSCO, MCD, ABT, NKE, TMUS, DHR, VZ, NEE, DIS, WFC, ADBE, SCHW, PM, BMY, CMCSA, TXN, UPS, COP, HON, MS, AMGN, T, NFLX, CRM, DE, LMT, UNP, IBM, CAT, QCOM, ELV, LOW, GS, CVS, SBUX, BA, SPGI, AXP, INTU, INTC, GILD, BLK, AMD, ADP, AMT, ISRG, SONY, SYK, TJX, MDLZ, EL, JD, C, PLD, NOC, ADI, AMAT, MMC, PYPL, and MO.
JSON:
User
Backtest these 2 portfolios from 01/01/2023 to 01/01/2025
Aurora
I'll set up a backtest for your two Mswing portfolios, using the 2022 stock list, to run from January 1, 2023, to January 1, 2025.
User
Backtest these 2 portfolios from 01/01/2024 to today
Aurora
I'll set up a backtest for your two Mswing portfolios using the 2022 stock list, running from January 1, 2024, to today, August 15, 2025.
This is a bounded preview of a long transcript. Open the interactive view for the complete conversation.