{"id":1521,"date":"2024-05-21T13:00:00","date_gmt":"2024-05-21T13:00:00","guid":{"rendered":"https:\/\/www.tejwin.com\/en\/insights\/tquant-lab-insider-transfer-strategy\/"},"modified":"2024-05-21T13:00:00","modified_gmt":"2024-05-21T13:00:00","slug":"tquant-lab-insider-transfer-strategy","status":"publish","type":"insight","link":"https:\/\/www.tejwin.com\/en\/insights\/tquant-lab-insider-transfer-strategy\/","title":{"rendered":"Insider Transfer Strategy: A Solution to Timing Difficulties"},"content":{"rendered":"<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"Insider Transfer Strategy\" class=\"wp-image-23330\" height=\"3264\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/robert-bye-QWM1e3lLnGA-unsplash.jpg\" width=\"4896\"\/><figcaption class=\"wp-element-caption\">Photo by <a class=\"ek-link\" href=\"https:\/\/unsplash.com\/@robertbye\" rel=\"noopener\" target=\"_blank\">Robert Bye<\/a> on <a class=\"ek-link\" href=\"https:\/\/unsplash.com\/\" rel=\"noopener\" target=\"_blank\">Unsplash<\/a><\/figcaption><\/figure>\n<h2 class=\"wp-block-heading\">Highlight<\/h2>\n<ul class=\"wp-block-list\">\n<li>Article Difficulty: \u2605\u2605\u2606\u2606\u2606<\/li>\n<li>This article will introduce the approach of importing information obtained from <code>TEJToolAPI<\/code> into <code>Pipeline<\/code> and use it in a strategy framework.<\/li>\n<li>By identifying entry points through the timing of insider share transfers, we form an insider transfer strategy and backtest its performance using TQuant Lab.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">Preface<\/h2>\n<p class=\"wp-block-paragraph\">In the dynamic landscape of today\u2019s stock market, the activities of major investors often trigger significant price fluctuations. Among the various factors influencing these changes, the transfer of shares by directors and supervisors stands out. These insiders, armed with a profound understanding of the company\u2019s operations, can wield substantial influence over its stock price. Consequently, when news of their share transfers surfaces, investors are quick to follow suit, aiming to capitalize on the resulting market swings.<\/p>\n<p class=\"wp-block-paragraph\">As per the Taiwan Stock Exchange, the first quarter of 2024 witnessed a surge in market enthusiasm, with 4,879,506 individual investors engaging in transactions valued at less than NT$100 million, which is the highest in seven years. This trend, coupled with the stock market\u2019s continuous ascent to new highs, underscores the importance of timing in market entry and the need to avoid purchasing at peak prices. To illustrate this, we will integrate the concept of insider share transfers with TQuant Lab, a powerful tool for backtesting strategies. This will allow us to thoroughly examine the performance of the Insider Transfer Strategy, shedding light on its potential benefits.<\/p>\n<h2 class=\"wp-block-heading\">Insider Transfer Strategy<\/h2>\n<p class=\"wp-block-paragraph\">In this article, MSCI constituent stocks are used as the stock pool, and we select from the following insider transfer methods: general trading, block trading, and general trading combined with block trading. The insider transfer strategy is built and backtested using the following rules:<\/p>\n<ul class=\"wp-block-list\">\n<li>If an insider transfer occurs, buy or add NT$15,000 worth of shares. ( Note: The initial capital for this strategy is NT$1,000,000. )<\/li>\n<li>If the RSI &gt; 95, indicating a strong overbought sentiment in the market, sell half of the position.<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\">Coding Environment and Module Requirements<\/h3>\n<p class=\"wp-block-paragraph\">This article is written using Windows 11 and Jupyter Lab as the editor.<\/p>\n<h3 class=\"wp-block-heading\">Selecting Stock Pool and Trading Data Import<\/h3>\n<p class=\"wp-block-paragraph\">We first obtain MSCI constituent stocks by <code>get_universe<\/code> function and <code>TEJToolAPI.<\/code><\/p>\n<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"Insider Transfer Strategy\" class=\"wp-image-23448\" height=\"482\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/MSCI.png\" width=\"530\"\/><figcaption class=\"wp-element-caption\">Selecting MSCI constituent stocks from TEJ Tool API<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">With the backtest period set from May 2, 2019, to May 1, 2024, we then import the price and volume data of the 89 MSCI constituent stocks and the TAIEX-Total Return Index (IR0001) as the performance benchmark.<\/p>\n<h3 class=\"wp-block-heading\">Obtain the Insider Transfer Data<\/h3>\n<p class=\"wp-block-paragraph\">Here, we use the <code>TEJToolAPI<\/code> to obtain the daily data of each stock\u2019s transfer start date, transfer end date, and transfer method. Furthermore, we added a transfer column to indicate whether there was an insider transfer of general trading, block trading, or general trading combined with block trading on that day.<\/p>\n<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"Insider Transfer Strategy\" class=\"wp-image-23392\" height=\"376\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/data_all.png\" width=\"681\"\/><figcaption class=\"wp-element-caption\">The Insider Transfer Data from TEJ Tool API<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\">Adding Transfer Information to Pipeline<\/h3>\n<p class=\"wp-block-paragraph\"><code>CustomDataset<\/code> allows us to import database content into <code>Pipeline<\/code>, facilitating subsequent backtesting. In this implementation, we use it to import the daily transfer information recorded in the <em>transfer<\/em> column into <code>Pipeline<\/code>. Part of the code is as follows:<\/p>\n<pre class=\"wp-block-code\"><code>from zipline.pipeline.data.dataset import Column, DataSet\nfrom zipline.pipeline.domain import TW_EQUITIES\n\nclass CustomDataset(DataSet):\n    \n    Transfer_Method_English = Column(object)\n    transfer = Column(bool)\n\n    domain = TW_EQUITIES<\/code><\/pre>\n<h3 class=\"wp-block-heading\">Construct the Insider Transfer Strategy<\/h3>\n<p class=\"wp-block-paragraph\">From the <code>pipeline<\/code> and <code>zipline<\/code> functions provided in TQuant Lab, we can:<\/p>\n<ol class=\"wp-block-list\">\n<li>Calculate the RSI value using the <a class=\"ek-link\" href=\"https:\/\/github.com\/tejtw\/TQuant-Lab\/blob\/main\/lecture\/Pipeline%20built-in%20factors.ipynb\" rel=\"noopener\" target=\"_blank\">built-in factors<\/a> from <code>pipeline<\/code>.<\/li>\n<li>Add the transfer methods and daily transfer data into <code>pipeline<\/code>.<\/li>\n<li>Add liquidity slippage and transaction fees, and set the return of the TAIEX-Total Return Index as the benchmark.<\/li>\n<li>Set the restriction to only long positions that can be constructed in the strategy.<\/li>\n<li>Set the Insider Transfer Strategy and record the transaction details.<\/li>\n<\/ol>\n<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"Insider Transfer Strategy\" class=\"wp-image-23408\" height=\"376\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/pipeline.png\" style=\"object-fit:cover\" width=\"675\"\/><figcaption class=\"wp-element-caption\">Pipeline Results to be Used in Our Strategy<\/figcaption><\/figure>\n<div style=\"border: 1px black; border-style: solid none; text-align: center; border-color: #296580; padding: 24px; margin-top: 24px; margin-bottom: 24px;\">\n<p style=\"margin: 0px; font-size: 24px; font-weight: bold; line-height: 1.5;\">Start Building Portfolios That Outperform the Market!<\/p>\n<div style=\"margin-top: 32px;\"><strong><a href=\"\/en\/databank-solution\/market-data\/\" style=\"border: none; border-radius: 4px; background-color: #296580; color: white; font-size: 20px; width: fit-content; text-decoration: none; padding: 12px 30px 12px 30px;\">TEJ Market Databank<\/a><\/strong><\/div>\n<\/div>\n<h2 class=\"wp-block-heading\">Execute the Trading Strategy<\/h2>\n<p class=\"wp-block-paragraph\">We use <code>run_algorithm()<\/code> function to execute the configured Insider Transfer Strategy with the trading period from 2019-05-02 to 2024-05-01 and with the initial capital of 1,000,000 NTD. The output, or\u00a0<em>results<\/em>, will represent the daily performance and detailed transaction records.<\/p>\n<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"Insider Transfer Strategy\" class=\"wp-image-23417\" height=\"587\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/result.png\" width=\"1080\"\/><figcaption class=\"wp-element-caption\">Trading Details<\/figcaption><\/figure>\n<h2 class=\"wp-block-heading\">Performance Evaluation Using Pyfolio<\/h2>\n<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"Insider Transfer Strategy\" class=\"wp-image-23421\" height=\"607\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/adds.jpg\" width=\"1069\"\/><figcaption class=\"wp-element-caption\">Backtesting Performance Compared to Benchmark<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">The table above shows that the insider transfer strategy achieved an annualized return of 19.348%. Additionally, the Sharpe and Sortino ratios are 1.22 and 1.75, respectively, as well as an alpha value of 0.06.\u00a0This\u00a0indicates that the insider transfer strategy can generate excess returns under the unit of risk taken and has a certain degree of capital protection capability during downside risks. Observing the chart, we can find that the strategy\u2019s performance was slightly below the market index before April 2021. After that, it officially surpassed the market index performance. The reason is that initially, the strategy was still in the building phase, so its performance could have been better than the market. However, once the positions were established and combined with the RSI indicator for exits during overbought periods, it effectively avoided bear market risks and achieved performance that exceeded the market index.<\/p>\n<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"Insider Transfer Strategy\" class=\"wp-image-23425\" height=\"342\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/exposure.png\" width=\"1077\"\/><figcaption class=\"wp-element-caption\">Exposure Chart of Long and Short Positions<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">The exposure chart of long and short positions helps us understand the use of capital in long and short positions. From the above chart, we can see that the insider transfer strategy was building positions in the early phase. By the end of 2021, it sold part of the holdings with the help of the RSI indicator, avoiding the bear market trend in 2022 to a certain extent.<\/p>\n<div aria-hidden=\"true\" class=\"wp-block-spacer\" style=\"height:22px\"><\/div>\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-6420e81a wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-font-size\" style=\"font-size:22px\"><a class=\"wp-block-button__link has-background wp-element-button\" href=\"\/en\/databank-solution\/market-data\/\" style=\"border-radius:16px;background:linear-gradient(135deg,rgb(160,209,216) 0%,rgb(51,145,181) 50%,rgb(50,95,191) 100%)\"><strong>Access to Comprehensive Retail Investors Data<\/strong><br \/><strong>Start Building Portfolios That Outperform the Market Today!<\/strong><\/a><\/div>\n<\/div>\n<div aria-hidden=\"true\" class=\"wp-block-spacer\" style=\"height:22px\"><\/div>\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n<p class=\"wp-block-paragraph\">This strategy is inspired by directors\u2019 and supervisors\u2019 stock transfers, aiming to explore whether buying stocks when these insiders report transfers can effectively time the market in a consistently rising market. By combining the timing of insider transfers with the RSI indicator, the strategy slightly outperformed the market in backtesting. However, it\u2019s important to note that this example uses MSCI large-cap stocks, and results may differ with mid- or small-cap stocks. Additionally, investment amounts should be based on current stock trends and individual risk tolerance for more stable returns.<\/p>\n<p class=\"wp-block-paragraph\"><strong>Please note that the strategy and target discussed in this article are for reference only and do not constitute any recommendation for specific commodities or investments<\/strong>. In the future, we will also introduce using the TEJ database to construct various indicators and backtest their performance. Therefore, we welcome readers interested in various trading strategies to consider purchasing relevant solutions from\u00a0<a class=\"ek-link\" href=\"https:\/\/tquant.tejwin.com\/\" rel=\"noreferrer noopener\" target=\"_blank\">TQuant Lab<\/a>. With our high-quality databases, you can construct a trading strategy that suits your needs.<\/p>\n<p class=\"has-text-align-center wp-block-paragraph\" style=\"font-size:32px\"><mark class=\"has-inline-color has-vivid-cyan-blue-color\" style=\"background-color:rgba(0, 0, 0, 0)\"><strong><em>\u201cTaiwan stock market data, TEJ collect it all.\u201d<\/em><\/strong><\/mark><\/p>\n<h2 class=\"wp-block-heading\">Extended Reading<\/h2>\n<ul class=\"wp-block-list\">\n<li><a class=\"ek-link\" href=\"\/en\/insight\/insider-transfers\/\">\u201cBlock Trades\u201d as Warning Signals? Analyzing Insider Transfers and Changes in Stock Prices Using TEJ API<\/a><\/li>\n<li><a class=\"ek-link\" href=\"\/en\/insight\/tquant-lab-ichimoku-kinko-hyo\/\">TQuant Lab Ichimoku Kinko Hyo Strategy, A Self-contained Technical Analysis Indicator<\/a><\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">The characteristics of the Taiwan stock market differ from those of other European and American markets, and <mark class=\"has-inline-color has-black-color\" style=\"background-color:rgba(0, 0, 0, 0)\"><span class=\"ek-underline\" style=\"text-decoration: underline;\">the dynamics of retail investors are worth noting<\/span><\/mark>. Especially in the first quarter of 2024, with the <strong><mark class=\"has-inline-color\" style=\"background-color:rgba(0, 0, 0, 0);color:#c05d5d\">Taiwan Stock Exchange reaching a new high of 20,000 points<\/mark><\/strong> due to the rise in TSMC\u2019s stock price, global institutional investors are paying more attention to the performance of the Taiwan stock market.\u00a0<\/p>\n<p class=\"wp-block-paragraph\"><strong><mark class=\"has-inline-color\" style=\"background-color:rgba(0, 0, 0, 0);color:#0978b8\">Taiwan Economical Journal (TEJ)<\/mark><\/strong>, 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.\u00a0<\/p>\n<ul class=\"wp-block-list\">\n<li><strong><mark class=\"has-inline-color has-black-color\" style=\"background-color:#ebc766\">Complete Coverage<\/mark><\/strong>: Includes all listed companies on stock markets in Taiwan, China, Hong Kong, Japan, Korea, etc.\u00a0<\/li>\n<li><strong><mark class=\"has-inline-color\" style=\"background-color:#ebc766\">Comprehensive Analysis of Enterprises<\/mark><\/strong>: Operational aspects, financial aspects, securities market performance, ESG sustainability, etc.\u00a0<\/li>\n<li><strong><mark class=\"has-inline-color\" style=\"background-color:#ebc766\">High-Quality Database<\/mark><\/strong>: TEJ data is cleaned, checked, enhanced, and integrated to ensure it meets the information needs of financial and market analysis.\u00a0<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">With TEJ\u2019s 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!<\/p>\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-3e41869c wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-100 has-custom-font-size\" style=\"font-size:21px\"><a class=\"wp-block-button__link has-background has-text-align-center wp-element-button\" href=\"\/en\/contact\/\" style=\"border-radius:16px;background:linear-gradient(135deg,rgb(160,209,216) 0%,rgb(51,145,181) 50%,rgb(50,95,191) 100%)\"><strong>Want to Learn More About Our Databases?<br \/>Contact Us and Get the Free Trial!<\/strong><\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The insider transfer strategy was constructed by adding the RSI indicator to the timing of insider transfers,  aiming to explore whether following insiders into the market in a constantly rising stock market has good timing capabilities. The performance of insider transfer strategy is also backtested in this article.<\/p>\n","protected":false},"featured_media":1514,"template":"","tags":[70,71,101,117,50,65],"insight_category":[13],"class_list":["post-1521","insight","type-insight","status-publish","has-post-thumbnail","hentry","tag-tej-api","tag-quantitative-strategy","tag-directors-holding","tag-insider","tag-market-data","tag-python","insight_category-quant-research"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight\/1521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight"}],"about":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/types\/insight"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/media\/1514"}],"wp:attachment":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/media?parent=1521"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/tags?post=1521"},{"taxonomy":"insight_category","embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight_category?post=1521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}