Table of Contents
What are measuring stocks? The stock index deals with stocks with abnormal trading conditions. What is abnormal trading status? The stock exchange has a classification mechanism. Before a stock is included in the “Measuring Stocks” list, it will be listed as “Attention Stocks” for a period of time. The “Attention Stocks” selection criteria are actually precursors to abnormal trading conditions. “Attention stocks” are defined as stocks that may be classified as attention stocks if their cumulative rise or fall in six days exceeds 25%. This kind of abnormal trading situation is usually based on several conditions, such as the range of increase and decrease, turnover rate, and whether the trading volume is reported to be significant. The competent authorities have formulated this cooling mechanism for warning handling to reduce investor risks and avoid overheating.
The stock 00940, which has recently gained significant attention, has also been noticed by the competent authorities. Despite not being listed on the market yet, it has managed to raise over 170 billion. If it does get listed, given its current popularity, it could be classified as a note stock or even a measuring stock by the authorities. This raises the question of whether measuring stocks are a terrible investment target. To answer this, we will conduct a simple buy and hold backtest on the performance of measuring stocks.
This article uses Windows and Jupyter Notebook as the editor.
import os
import pandas as pd
import TejToolAPI
from zipline.data import bundles
from logbook import Logger, StderrHandler, ERROR
from zipline.sources.TEJ_Api_Data import get_universe
os.environ['TEJAPI_KEY'] = "your key"
os.environ['TEJAPI_BASE'] = "https://api.tej.com.tw"
start = '2020-01-01'
end = '2023-12-31'
pool = get_universe(start, end, mkt = ['TWSE', 'OTC'], stktp_c = '普通股')
os.environ['mdate'] = start + ' ' + end
os.environ['ticker'] = ' '.join(pool) + ' ' + 'IR0001'
!zipline ingest -b tquant
The data period is from 2020-01-01 to 2023-12-31, and the weighted return index IR0001 is added as a market comparison.
The initialize()
function is used to define the daily trading environment before the start of trading. In this example, we set:
before_trading_start()
is similar to handle_data()
. It is called daily after the start of backtesting and is mainly responsible for setting trading strategies, placing orders, and recording trading information.
Run_algorithm()
is used to execute the momentum factor strategy as configured. The trading period is set from start_dt
(2020-01-01) to end_dt
(2023-12-31), using the dataset tquant, with initial capital of ten million dollars. The output results
represent daily performance and trading details.
Start Building Portfolios That Outperform the Market!
import pyfolio as pf
from pyfolio.utils import extract_rets_pos_txn_from_zipline
returns, positions, transactions = pf.utils.extract_rets_pos_txn_from_zipline(results)
benchmark_rets = results.benchmark_return
# Creating a Full Tear Sheet
pf.create_full_tear_sheet(returns, positions = positions, transactions = transactions,
benchmark_rets = benchmark_rets,
round_trips=False)
As seen from the chart above, we have obtained an annualized return of approximately 19.71% during these 46 months through buying and selling measuring stocks, and the cumulative return is approximately 100%. The performance is barely in line with the market. However, buying and selling measuring stocks is a riskier investment strategy than the broader market. Because the characteristic of measuring stocks is that the buying and selling time is longer, investors cannot conduct transactions promptly, resulting in a lower willingness to hold. Therefore, when a stock falls into a period of decline, the decline will be significantly more significant than the broader market, resulting in sluggish strategy performance. The competent authorities will list a stock as a measuring stock because the turnover and increase rates are too abnormal compared with past performance. Therefore, before buying an overheated stock, you must first anticipate whether the stock will be listed as a note or measuring stock by the regulatory authorities to avoid exposure to more significant risks than other stocks.
As seen from the chart above, the monthly return of the investment strategy of buying and selling measuring stocks is poor and has a very high rate of negative returns. Investors will be under considerable pressure when adopting this investment strategy.
In this implementation, we selected measuring stocks as investment targets and used TQuant Lab to conduct a backtest performance analysis of buying, selling, and holding targets. Judging from the study’s results, measuring stocks’ annual return and cumulative return rates are barely the same as those of the broader market, but the risks investors bear are pretty high. When two groups of investment strategies have the same profit, investors should choose the investment target with lower risk as the investment target to avoid the problem of mismatch between risk and return.
The author believes that blindly following overheated stocks will be extremely risky. Buffett once said: “Others are fearful, and I am greedy.” This means that when others enter the market with a hot head, you follow; when others are bullish, you also Follow the stop loss, but the real winner is not to look at the current situation but to look carefully from a distance. Therefore, investors should think from a long-term perspective and avoid unthinkingly following market fluctuations. Evaluating and considering multiple perspectives when purchasing a stock is essential to ensure you are making an informed investment decision.
Therefore, readers interested in various trading backtesting scenarios are welcome to purchase relevant solutions from TEJ Market Data to construct their trading strategies using high-quality databases.
This is a gentle reminder that this strategy is for reference only and does not represent advice on commodities or investments.
“Taiwan stock market data, TEJ collect it all.”
The characteristics of the Taiwan stock market differ from those of other European and American markets, and the dynamics of retail investors are worth noting. Especially in the first quarter of 2024, with the Taiwan Stock Exchange reaching a new high of 20,000 points due to the rise in TSMC’s stock price, global institutional investors are paying more attention to the performance of the Taiwan stock market.
Taiwan Economical Journal (TEJ), a financial database established in Taiwan for over 30 years, serves local financial institutions and academic institutions, and has long-term cooperation with internationally renowned data providers, providing high-quality financial data for five financial markets in Asia.
With TEJ’s assistance, you can access relevant information about major stock markets in Asia, such as securities market, financials data, enterprise operations, board of directors, sustainability data, etc., providing investors with timely and high-quality content. Additionally, TEJ offers advisory services to help solve problems in theoretical practice and financial management!
Subscribe to newsletter