Stopping loss and shorting don’t work. What worked was only the bland “diversification.”
Hello, I am Cron. While managing as an infrastructure engineer, I am building a swing bot for Japanese stocks with AI (Claude Code). I am a beginner at both programming and day trading.
*This article is a development log as of September 2, 2026.
Today was a day of adding an “improvement idea” to the bot’s strategy. I tried five well-known theories,and all five were discarded. What remained was only one quiet idea.
You might think, reading about a string of losses is pointless… but,this experience of “five losses and one remains” is probably the most useful in itself. The two things you’ll understand from this article are:
- Trading theory is a general rule that is “generally correct” and “works for my method” are different things
- What worked wasn’t flashy triggers, but the quiet thing called “diversification”
First, what is my strategy?
If I don’t explain this, the discussion won’t progress, so I’ll keep it brief.
My Bot’s strategy is,every month, replace with the number one strongest large-cap stock at that time. I don’t look at whether a particular company is undervalued. I decide mechanically based on past price momentum. In our case,one-in-a-month (we call it “once a month” because we switch monthly).
This includes a “safety valve.” If the overall market starts to break down, the stock portion is automatically reduced, and the leftover portion waits in cash.Prioritize not losing a lot over aggressive gainsas the design.
Today’s task was to add something to this once-a-month switch andsee if I could make the pain of a down market smaller (i.e., how much assets could dip at maximum), by using backtesting (testing the strategy on past data). It runs on roughly 21 years of Japanese stock data.
Discard ① “Stop loss is absolute”
The most famous one. “If the purchase price falls by a fixed percentage, automatically sell to realize the loss.”
I added this fixed stop loss to the once-a-month switch. The result was,the annualized return dropped, and the maximum drawdown hardly changed. Making the stop loss more severe made performance worse.
The reason is simple: the once-a-month switch rebalances across many different stocks each month, so drawdown is caused by the market-wide decline, not a single stock crash. Even selling a single stock early wouldn’t help. Moreover, after selling a weak stock, there can be a V-shaped recovery, causing you to miss the upside.
Discard ② “In a bear market, you profit from shorts”
There is an old idea that markets have uptrends and downtrends. So in a down market, should you hold a product that profits when prices fall (an inverse ETF — a fund designed to move opposite to the index)?
I tried this as well. In weak markets, I allocated part of cash to the inverse side. The result was,in almost all past periods, the maximum drawdown became deeper than the baseline.
What worked was rare — only about once in 20 years was there a long-term unidirectional decline. In other market conditions, every dip and quick rebound eroded the gains. You can’t know in advance when the genuine down market will occur.
Discard ③ Genuine long/short
“Short weak stocks (borrow and sell before you own them, buy back later) and combine with buying strong stocks, so you can earn on the spread regardless of market direction.” The logic is elegant.
I tested widening the pool of target stocks to over 200, and pairing long and short with equal weight. The result was,negative annualized return at the backtest stage. Even though long-only would have been positive, the short side took everything.
In Japan’s large-cap stocks, most “losers” are actually temporarily sold-off quality companies, which tend to recover with time. Shorting them repeatedly was a structurally losing bet.
Discard ④⑤ “Make judgments stricter” and “stock selection stricter”
Two more.
- Be stricter about bear market judgments: Don’t reduce positions just because price breaks through a line; wait for several days of sustained break before reducing. → While waiting, you ride the downmove longer and the maximum drawdown worsens.
- Be stricter about selecting stocks: Only hold stocks that are rising, add more conditions. → It looked good recently, but when the period was split into early/late halves, it collapsed. It was a case of overfitting to recent market conditions.
Why didn’t all five work
If you lay them out side by side, you’ll see a pattern.“Go against the trend,” “Try to ride the trend,” “Move late”Triggers don’t work well with momentum-based strategies like the once-a-month approach, because they get chopped up by quick reversals (V-shaped recoveries).
This isn’t just my finding; momentum strategies are known to be vulnerable to stagnation and sharp reversals in flat markets (reference: Above the Green Line). The rule “cut losses quickly” is also shown by data to sometimes be less than ideal (reference: Diamond Online).
And importantly,the defensive side in a down market was already enough with the built-in safety valve (hold cash when wrecked). Adding anything on top made performance worse. Subtraction was the right approach.
The only remaining idea: mix in a little gold
After five losses, the last thing I tried was this.Put a portion of the once-a-month assets (about 10–20%) in gold.
The reason for choosing gold is that its price movements are almost uncorrelated with my strategy. The correlation indicator is basically zero (around +0.2). Gold itself also has a historically gradual upward trend.
As a result,the maximum drawdown shrank from about 40% to just under 30%. The risk-adjusted return improved by nearly 20%, and the annualized return did not drop. Even when splitting the period into early/late halves, drawdowns were milder in both periods. This is not a coincidence.
The key takeaway is that“buying gold only in a down market” did not work. That approach caused late buying and late selling. The diversification only becomes effective when held across the cycle.
In other words, the winning approach wasn’t a momentum-leaning trigger, buta simple strategy of mixing in assets that don’t move in sync and holding them over time.
Two more blunders
1) Data with bad values pushed assets to over 1 billion yen in 20 years
Gold price data included rare bad data where values would shift by about 1/100 in a year. Calculating with that kept producing an unrealistic result. I identified the cause and switched to a different method (gold futures × USD/JPY) to fix it.
2) AI noticed its own mistake and fixed it
During testing, a record intended for testing ended up mixed into real trading data,accidentally entered into production logs. A small pitfall in the program. I’m letting this Bot be run by AI, but this “trust it” aspect can be scary.
What was interesting is thatClaude Code noticed it on its own and put it back. Fake data leaves a timestamp marker, and it used that to recover in a little over 10 minutes. Even without human instruction, it noticed, “Hey, this isn’t a production file, is it?” and acted. Honestly,it’s a very capable and autonomous partner, I thought.
But at the same time, it’s a little scary.Being able to notice and fix on its own means it could also break things without noticing. This time, the marker helped. So when letting AI write code, I think humans should ensure testing data is strictly isolated from real data first. I see this as my responsibility.
Today’s lessons and what’s next
Don’t try to cram every spontaneous idea in; validate and decide not to add it.
The theory seems to be “it sounds right because everyone says so,” but whether it works in my environment (strategy, capital, market) is another matter. I tried five improvement ideas and discarded them all; the subsequent gold diversification was the only thing that was “quiet but effective.” The conclusion is that subtraction was the correct approach.
Next, at the end of September’s replacement timing, I will actually incorporate this “holding a little gold” into the real once-a-month approach. The ideas that passed backtesting will be placed into production for the first time.
To those who are stuck on questions like “How should I set stop-loss rules?” in the same way,the answer is to verify with your own trading records. Don’t rely on someone else’s answer; draw your own conclusions from your data. It’s simple, but it’s the most effective method.
*This article is my development log. It does not recommend specific stocks or methods. Investment is a personal judgment.