ESSAYS · · 3 MIN READ

Using AI as a Contrarian Signal in a Sideways Market

A pattern in my own trading logs made me ask whether a confident model answer can surface assumptions worth questioning.

Zuliang Zhao
Using AI as a Contrarian Signal in a Sideways Market

This essay reflects my own trading observations and is not investment advice.

I’ve been using AI to help follow China’s A-share market for about half a year. One pattern in my own work surprised me. In a sideways market, the direction an AI model confidently recommends can sometimes be more useful as a reading of prevailing sentiment than as a trade to follow. I started treating it as a possible contrarian signal.

I am following a position, rather than screening a market

Much AI research and many commercial products focus on selecting stocks from a large universe.12 My question starts after selection. If I have picked one way to follow a long-term theme such as semiconductors, I watch that position over time and decide when to adjust it. Stock selection is choosing the seed. I have already planted it, and I’m deciding when to water it. A portfolio-wide result doesn’t necessarily answer that question.

What I saw in the logs

I built a five-step process. A more capable model writes a proposal, another model challenges its data and logic, they go through several rounds, and the workflow produces an execution instruction for me to consider. I refined it with news, trading data, and the results of my own decisions. On clear trends, the suggestions about price levels, indicators, and position sizes were often useful.

In sideways periods I compared the suggestions with what I actually did. One category was taking the opposite direction: the model suggested buying and I sold, or the reverse. In the sideways stretches in my own records that happened in roughly 50–70% of cases across several positions. My system estimated that the decisions I actually made kept me around break-even in one span and that consistently following its suggestions would have hurt results. That’s a result from my own logs and the system’s counterfactual, rather than an independent or general test of contrarian trading.

A confident call may be a measure of consensus

I think the model is recognizing patterns in past prices, volumes, and indicators. When a trend is established, that can be useful. In a sideways market the same evidence leaves more room for uncertainty, especially if the prompt requires a direction. A forceful call may express the direction the available evidence most readily supports. By the time a market consensus forms, much of the buying or selling it implied may already be done.

That is my explanation of the pattern. The model’s output isn’t a direct survey of real-time investor beliefs, and a consensus reading alone does not identify a turning point. I use it as a question to ask of the evidence, not as a reason to take the other side every time.

What I changed about the way I use it

I first ask whether I’m looking at a trend or a range. A strong signal in the range gives me a reason to look harder at the opposite case. I also changed the question. Instead of asking whether to buy here, I ask what my assessment is missing and what facts would make the bullish case fail. Last, I continued following particular holdings over time. That makes it possible to compare what changed and what actually happened, a different goal from optimizing a large portfolio all at once.

Institutions can spend more on data, compute, and models than I can. I have more control over whether I notice the conditions under which my own system misleads me. An AI hasn’t given me a reliable way to make money. It can help me see a part of the situation I was close to missing.

The Chinese edition also cites the author’s trading logs and industry reporting by 21st Century Business Herald.

Footnotes

  1. Cong, Tang, and Wang, AlphaPortfolio: Direct Portfolio Construction via Deep Reinforcement Learning, NBER Working Paper 35195, 2026. ↩

  2. Hillsdale Investments, Machine Learning for Stock Selection, 2019. ↩