Challenge in Building Trading Rules — Japanese Stock System Trading Basic Course ⑧
Challenge the Construction of Trading Rules
I am a securities analyst and a seminar lecturer on system trading, Tsuyoshi Nishimura of Fairtrade Co., Ltd. In this course, we will explain in simple words and expressions so that everyone who watches can understand "system trading" from the basics. Please stay with us until the end. The theme this time is "challenging the construction of trading rules." Now, let's get into it.
This is a recap of previous lectures, but system trading essentially starts with "discovering statistically superior patterns." However, since overwhelmingly advantageous patterns rarely exist, it is very important to search for patterns with even a slight edge. So this time, the theme is to "challenge the construction of trading rules" with simple examples. The rules to be constructed can apply to stocks or Nikkei 225 futures, but this time we will focus on stocks, which are believed to be in highest demand.
In the stock market, the most clearly advantageous and easiest-to-understand example would be the rebound after a sharp drop.
The logic is that the more a stock has fallen, the bigger the rebound can be expected. Based on this, we will first verify how much advantage there is when buying a stock that has fallen significantly.
In system trading, simply "buying a stock that has fallen too much" is not allowed, so it is necessary to determine "how strongly it fell" with precise numbers.
As an example, we define a stock as oversold if its divergence from the 5-day moving average is -15% or less. In actual trading, you also need a selling (settlement) rule, but to keep things simple, we will set the profit-taking and stop-loss conditions to be the same.
Specifically, we set both the take-profit and stop-loss ranges to 5%. In other words, if the price rises 5% from the purchase price, we will settle at the next day's opening price to take profit; conversely, if it falls 5% from the purchase price, we will also settle at the next day's opening price for the stop loss. The trading rules can be summarized as follows.
┌───────────────────────────────┐
[Buy Rule]
・Divergence between the 5-day moving average and the closing price is -15% or less
[Sell Rule]
・Unrealized profit is 5% or more, or
・Unrealized loss is 5% or more
※ All trades are executed at the next day's opening price (start price)
└───────────────────────────────┘
For confirmation, the above rules are to check how much advantage there is when buying oversold stocks. A basic rule with this level of simplicity is sufficient as a first stage. We tested what would happen if we continued to trade with 10 stocks diversified each time using this rule.
┌───────────────────────────────┐
[Test Results] (Test period: 2000/01/01–2008/08/29)
Win rate: 48.5% (Wins: 1125, Losses: 1194)
Average return: +0.63%
Average holding period: 3.52 days
※ Trading commissions, etc. not considered
└───────────────────────────────┘
As you can see from the above results, if you had traded oversold stocks since 2000, there would be about a +0.6% advantage per trade. However, this result does not account for trading fees, so after deducting commissions there may not be a substantial advantage. If at this stage there is no noticeable edge, further tweaking may be pointless. Fortunately, this initial test showed some advantage, so let's try to improve the performance a bit by refining this basic rule.
There are many ideas to improve performance. This is where your sense in rule creation is tested.
For example, p>
・What happens if you add market condition determination (whether the market is in a rising or falling phase)?
・What if you change the take-profit or stop-loss widths (percent)?
・Should you realize profits in small increments or let them run bigger?
・What happens if you tighten the divergence rate?
There are many ways to dramatically improve performance depending on your ideas. Now, I will temporarily apply my own adjustments to the trading rules. The previous basic rule is based on the concept of "counter-trend aiming for rebound after a drop."
Even for contrarian rules, it is generally more advantageous in an uptrend than in a downtrend. Therefore, I will add "only buy in uptrends" to the basic rule. Then, I want to examine what improvements can be achieved by incorporating market condition judgments.
There are various methods to determine whether the current market is in an uptrend, but this time we will judge based on the current closing price's position relative to the past year's high and low (250 trading days).
Specifically, we add the condition that the current closing price is in the top 50% (above the midpoint) when looking at the past 250 trading days' high and low. In simple terms, we only buy when the current closing price is above the midpoint of the past year's high and low. This allows us to add a market condition: do not buy unless the market is in an uptrend. The rules are summarized as follows.
┌───────────────────────────────┐
[Buy Rule]
・Divergence between the 5-day moving average and the closing price is -15% or less
・Current position of the closing price (250 days) is 50% or more
[Sell Rule]
・Unrealized profit is 5% or more, or
・Unrealized loss is 5% or more
※ All trades are executed at the next day's opening price└───────────────────────────────┘
And below are the backtest results under these conditions.
┌───────────────────────────────┐
[Test Results] (Test period: 2000/01/01–2008/08/29)
Win rate: 62.8% (Wins: 145, Losses: 86)
Average return: +5.22%
Average holding period: 2.62 days
※ Trading commissions, etc. not considered└───────────────────────────────┘
As you may be surprised, even with the same basic rule, by incorporating "market condition determination" into the rule, performance can change dramatically.
What used to be only about +0.6% advantage can be improved to at least +5% by adding the rule. One caveat: as you add rules, you inevitably reduce the number of trades. If you impose too strict rules, you may end up with very few trades. Therefore, balancing overall trade count and ensuring a reasonable number of trades is the best approach.
In this session, I explained "market condition determination" as a hint for generating your own trading rules. Depending on your ideas, you may still construct excellent rules. Please, everyone, take on the challenge of "construction of trading rules."