{"id":34042,"date":"2025-03-21T13:30:00","date_gmt":"2025-03-21T05:30:00","guid":{"rendered":"https:\/\/www.tejwin.com\/?post_type=insight&#038;p=34042"},"modified":"2025-04-02T17:39:28","modified_gmt":"2025-04-02T09:39:28","slug":"tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2","status":"publish","type":"insight","link":"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/","title":{"rendered":"[TQuant from 0 to 1 &#8211; Day 3] Building a Comprehensive Investment Data Perspective: Stock Pool Screening and Data Retrieval with TejToolAPI"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full caption-align-center\"><img fetchpriority=\"high\" decoding=\"async\" width=\"2426\" height=\"1728\" src=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/carlos-muza-hpjSkU2UYSU-unsplash-2.jpg\" alt=\"stock pool\" class=\"wp-image-31911\" srcset=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/carlos-muza-hpjSkU2UYSU-unsplash-2.jpg 2426w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/carlos-muza-hpjSkU2UYSU-unsplash-2-300x214.jpg 300w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/carlos-muza-hpjSkU2UYSU-unsplash-2-1024x729.jpg 1024w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/carlos-muza-hpjSkU2UYSU-unsplash-2-150x107.jpg 150w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/carlos-muza-hpjSkU2UYSU-unsplash-2-768x547.jpg 768w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/carlos-muza-hpjSkU2UYSU-unsplash-2-1536x1094.jpg 1536w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/carlos-muza-hpjSkU2UYSU-unsplash-2-2048x1459.jpg 2048w\" sizes=\"(max-width: 2426px) 100vw, 2426px\" \/><figcaption class=\"wp-element-caption\">Photo by <a href=\"https:\/\/unsplash.com\/@kmuza?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash\" target=\"_blank\" rel=\"noopener\">Carlos Muza<\/a> on <a href=\"https:\/\/unsplash.com\/photos\/laptop-computer-on-glass-top-table-hpjSkU2UYSU?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash\" target=\"_blank\" rel=\"noopener\">Unsplash<\/a><\/figcaption><\/figure>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a10e006cf619\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a10e006cf619\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Preface\" >Preface<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#What_is_a_Stock_Pool\" >What is a Stock Pool?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Benefits_of_a_Well-Designed_Stock_Pool\" >Benefits of a Well-Designed Stock Pool<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#1_Improved_Analysis_Efficiency\" >1. Improved Analysis Efficiency<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#2_Reducing_the_Impact_of_Survivor_Bias\" >2. Reducing the Impact of Survivor Bias<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#3_Automation_and_Quantitative_Applications\" >3. Automation and Quantitative Applications<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Introduction_to_the_get_universe_Function\" >Introduction to the get_universe Function<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Key_Features_of_get_universe\" >Key Features of get_universe<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Parameters_for_Defining_Screening_Time_Range_and_Trading_Calendar\" >Parameters for Defining Screening Time Range and Trading Calendar<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#1_start_datetime_or_str\" >1. start (datetime or str)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#2_end_datetime_or_str_optional_defaults_to_todays_date\" >2. end (datetime or str, optional, defaults to today\u2019s date)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#3_trading_calendar_TradingCalendar_optional_defaults_to_TEJ_XTAI\" >3. trading_calendar (TradingCalendar, optional, defaults to TEJ_XTAI)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Available_kwargs_Properties_At_Least_One_Must_Be_Specified\" >Available kwargs Properties (At Least One Must Be Specified)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Code_Examples\" >Code Examples<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#1_Import_Libraries_and_Set_Up\" >1. Import Libraries and Set Up<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#2_Nine_Stock_Pool_Screening_Examples_Using_get_universe\" >2. Nine Stock Pool Screening Examples Using get_universe<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Case_1_Retrieve_Securities_Previously_Listed_on_TWSE_General_Board_OTC_General_Board\" >Case 1: Retrieve Securities Previously Listed on TWSE General Board &amp; OTC General Board<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Case_2_Retrieve_Securities_Previously_Listed_on_the_Taiwan_OTC_Market\" >Case 2: Retrieve Securities Previously Listed on the Taiwan OTC Market<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Case_3_Retrieve_Common_Stocks_Previously_Listed_on_TWSE_OTC\" >Case 3: Retrieve Common Stocks Previously Listed on TWSE &amp; OTC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Case_4_Retrieve_Securities_Previously_Classified_as_%E2%80%9CM2324_%E5%8D%8A%E5%B0%8E%E9%AB%94%E6%A5%AD%E2%80%9D_Semiconductor_Industry\" >Case 4: Retrieve Securities Previously Classified as &#8220;M2324 \u534a\u5c0e\u9ad4\u696d&#8221; (Semiconductor Industry)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Case_5_Retrieve_Securities_Previously_Classified_as_%E2%80%9CM2324_Semiconductor%E2%80%9D_%E2%80%9CM2325_Computer_and_Peripheral_Equipment%E2%80%9D\" >Case 5: Retrieve Securities Previously Classified as &#8220;M2324 Semiconductor&#8221; &amp; &#8220;M2325 Computer and Peripheral Equipment&#8221;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Case_6_Retrieve_Securities_of_Type_%E2%80%9CETF%E2%80%9D_and_%E2%80%9C%E6%99%AE%E9%80%9A%E8%82%A1%E2%80%9D_Common_Stocks_Listed_on_TWSE\" >Case 6: Retrieve Securities of Type &#8220;ETF&#8221; and &#8220;\u666e\u901a\u80a1&#8221; (Common Stocks) Listed on TWSE<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Case_7_Retrieve_Securities_Previously_Included_in_%E2%80%9CIX0002%E2%80%9D_Taiwan_50_Index\" >Case 7: Retrieve Securities Previously Included in &#8220;IX0002&#8221; (Taiwan 50 Index)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Case_8_Retrieve_Securities_Previously_in_the_%E2%80%9CM1100_%E6%B0%B4%E6%B3%A5%E5%B7%A5%E6%A5%AD%E2%80%9D_Cement_Industry_and_Part_of_%E2%80%9CIX0006%E2%80%9D_Taiwan_High_Dividend_Index\" >Case 8: Retrieve Securities Previously in the &#8220;M1100 \u6c34\u6ce5\u5de5\u696d&#8221; (Cement Industry) and Part of &#8220;IX0006&#8221; (Taiwan High Dividend Index)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Case_9_Retrieve_Common_Stocks_in_Non-Financial_Industries\" >Case 9: Retrieve Common Stocks in Non-Financial Industries<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#TEJToolAPI\" >TEJToolAPI<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#TejToolAPIget_history_data_Function\" >TejToolAPI.get_history_data Function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#1_ticker_iterablestr\" >1. ticker (iterable[str])<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#2_columns_iterablestr\" >2. columns (iterable[str])<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#3_transfer_to_chinese_boolean_default_False\" >3. transfer_to_chinese (boolean, default: False)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#4_start_pdTimestamp_or_str\" >4. start (pd.Timestamp or str)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#5_end_pdTimestamp_or_str_optional_defaults_to_execution_date\" >5. end (pd.Timestamp or str, optional, defaults to execution date)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#6_fin_type_iterablestr\" >6. fin_type (iterable[str])<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#7_include_self_acc_str_default_%E2%80%98N\" >7. include_self_acc (str, default: &#8216;N&#8217;)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Example_Retrieve_Historical_EPS_Data_for_Selected_Stocks\" >Example: Retrieve Historical EPS Data for Selected Stocks<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-36\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Conclusion\" >Conclusion<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-37\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Why_Use_TejToolAPI\" >Why Use TejToolAPI?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-38\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Next_Steps\" >Next Steps<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-39\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#%E3%80%90TQuant_From_0_to_1_%E2%80%93_Day_3%E3%80%91Link_to_be_added\" >\u3010TQuant: From 0 to 1 \u2013 Day 3\u3011(Link to be added)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-40\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Extended_Reading\" >Extended Reading<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-41\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/tquant-from-0-to-1-day-3-building-a-comprehensive-investment-data-perspective-stock-pool-screening-and-data-retrieval-with-tejtoolapi-2\/#Useful_Links\" >Useful Links<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Preface\"><\/span>Preface<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>In financial investment, mastering accurate and comprehensive data is an indispensable skill, and effectively managing stock pools and acquiring stock price data is the key to unlocking this skill. With the tools and APIs provided by TQuant Lab, we can easily define screening criteria, quickly establish stock pools that meet specific requirements, and retrieve relevant historical stock price data.<\/strong><\/p>\n\n\n\n<p><strong>This article will guide you step by step through setting up the environment and configuring your API Key, as well as explain how to use the <\/strong><strong>get_universe function to obtain stock samples based on specific conditions. Whether you are a beginner in investing or a data analysis enthusiast, this guide will help you master the automation of data retrieval, laying a solid foundation for future quantitative analysis. Through examples and hands-on operations, you can quickly get started and apply these techniques to your investment strategies.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_a_Stock_Pool\"><\/span>What is a Stock Pool?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>A stock pool is like a shopping list in our daily lives. Imagine grocery shopping in a supermarket with thousands of products on the shelves. If you don&#8217;t filter your choices, you may spend a long time selecting items or buying things you don&#8217;t need. However, if you prepare a shopping list in advance, such as &#8220;breakfast ingredients&#8221; or &#8220;fitness diet,&#8221; you can quickly locate the relevant items in the store, saving time and improving efficiency.<\/strong><\/p>\n\n\n\n<p><strong>Similarly, a stock pool aims to help investors filter out stocks that meet specific criteria from the vast stock market. For instance, you might set a condition like:<\/strong><\/p>\n\n\n\n<p><strong>\u201cI want to find common stocks of semiconductor companies listed in Taiwan.\u201d<\/strong><\/p>\n\n\n\n<p><strong>With a stock pool, you get a curated list of stocks that meet this condition, just like a shopping list helps you focus on relevant grocery items. This allows you to concentrate on analyzing only the relevant stocks without wasting time on unrelated companies.<\/strong><\/p>\n\n\n\n<p><strong>In short, a stock pool acts as a &#8220;compass&#8221; in your investment journey, helping you navigate the complex market and providing a reliable foundation for decision-making.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Benefits_of_a_Well-Designed_Stock_Pool\"><\/span>Benefits of a Well-Designed Stock Pool<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Improved_Analysis_Efficiency\"><\/span><a><\/a><strong>1. Improved Analysis Efficiency<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>With thousands of stocks in the market, it is easy to get lost in a sea of data if you lack clear selection criteria. A well-defined stock pool lets you focus on relevant stocks quickly, saving time.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Reducing_the_Impact_of_Survivor_Bias\"><\/span><a><\/a><strong>2. Reducing the Impact of Survivor Bias<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>By setting specific selection criteria, a stock pool ensures that you consider both successful and failed companies, rather than only analyzing those that have survived. This helps create a more comprehensive view when backtesting investment strategies.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Automation_and_Quantitative_Applications\"><\/span><a><\/a><strong>3. Automation and Quantitative Applications<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>Stock pools can be integrated with quantitative strategies, aiding in backtesting and data analysis. This ensures that your investment targets are based on a filtered and reliable dataset, improving the accuracy and effectiveness of your analysis.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Introduction_to_the_get_universe_Function\"><\/span>Introduction to the get_universe Function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>In quantitative analysis and investment strategy design, quickly and accurately retrieving stock pool data is critical. With the tools provided by TQuant Lab, we can conveniently use the <\/strong><strong>get_universe function to create custom stock pools based on different screening criteria, laying the groundwork for subsequent analysis.<\/strong><\/p>\n\n\n\n<p><strong>The <\/strong><strong>get_universe function is primarily used to screen and return a list of stock symbols that meet specific conditions. It allows users to filter stocks within a particular time range based on criteria such as market type, industry, and security type. The resulting stock list can seamlessly integrate with quantitative strategies and backtesting tools.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Key_Features_of_get_universe\"><\/span><a><\/a><strong>Key Features of <\/strong><strong>get_universe<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>\u2705 Stock Pool Creation \u2013 Automatically filters stocks that meet the specified criteria, eliminating the need for manual selection.<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;\u2705 Conditional Filtering \u2013 Supports various screening conditions such as market type, sector, industry, index inclusion, etc.<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;\u2705 Dynamic Range Selection \u2013 Returns stocks that meet the criteria within a specified date range.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>get_universe(start,\nend = datetime.datetime.now().date().strftime(%Y-%m-%d),\ntrading_calender = get_calender('TEJ_XTAI'),\n**kwargs)\n\n\n<\/code><\/pre>\n\n\n\n<p><strong>Leveraging the get_universe function can significantly enhance your stock screening process, ensuring your investment analysis is based on structured and high-quality data.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full caption-align-center\"><img decoding=\"async\" width=\"1339\" height=\"516\" src=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-643.png\" alt=\"tejtoolapi\" class=\"wp-image-31924\" style=\"object-fit:cover\" srcset=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-643.png 1339w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-643-300x116.png 300w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-643-1024x395.png 1024w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-643-150x58.png 150w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-643-768x296.png 768w\" sizes=\"(max-width: 1339px) 100vw, 1339px\" \/><figcaption class=\"wp-element-caption\">The integration of the stock pool content relationships.<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Parameters_for_Defining_Screening_Time_Range_and_Trading_Calendar\"><\/span><strong>Parameters for Defining Screening Time Range and Trading Calendar<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>The following parameters are responsible for setting the time range and trading calendar when filtering the stock pool:<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_start_datetime_or_str\"><\/span><a><\/a><strong>1. <\/strong><strong>start<\/strong><strong> (datetime or str)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose: Specify the start date for stock pool filtering.<\/strong><\/li>\n\n\n\n<li><strong>Meaning: Returns stocks that meet the conditions from <\/strong><strong>start to <\/strong><strong>end.<\/strong><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_end_datetime_or_str_optional_defaults_to_todays_date\"><\/span><a><\/a><strong>2. <\/strong><strong>end<\/strong><strong> (datetime or str, optional, defaults to today\u2019s date)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose: Specify the end date for stock pool filtering.<\/strong><\/li>\n\n\n\n<li><strong>Description: If not provided, the system will use the execution date as the default end date.<\/strong><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_trading_calendar_TradingCalendar_optional_defaults_to_TEJ_XTAI\"><\/span><a><\/a><strong>3. <\/strong><strong>trading_calendar<\/strong><strong> (TradingCalendar, optional, defaults to <\/strong><strong>TEJ_XTAI<\/strong><strong>)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose: Defines the trading calendar, ensuring that only valid trading days within the specified date range are considered.<\/strong><\/li>\n\n\n\n<li><strong>Default Value: <\/strong><strong>TEJ_XTAI (The Taiwan Stock Exchange trading calendar).<\/strong><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Available_kwargs_Properties_At_Least_One_Must_Be_Specified\"><\/span><a><\/a><strong>Available <\/strong><strong>kwargs<\/strong><strong> Properties (At Least One Must Be Specified)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>The function will return all available stocks if no filtering criteria are specified.<\/strong><\/p>\n\n\n\n<p><strong>These parameters determine the content of the returned stock pool, including:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Market Type<\/strong><\/li>\n\n\n\n<li><strong>Sector (Chinese &amp; English)<\/strong><\/li>\n\n\n\n<li><strong>Security Type (Chinese &amp; English)<\/strong><\/li>\n\n\n\n<li><strong>Primary Industry (Chinese &amp; English)<\/strong><\/li>\n\n\n\n<li><strong>Sub-industry (Chinese &amp; English)<\/strong><\/li>\n\n\n\n<li><strong>Index Name<\/strong><\/li>\n<\/ul>\n\n\n\n<p><strong>These criteria can be customized flexibly based on your specific needs. For more details, please refer to the relevant documentation link.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Code_Examples\"><\/span><a><\/a><strong>Code Examples<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>We will walk through nine examples to help you better understand how to utilize the <\/strong><strong>get_universe function.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Import_Libraries_and_Set_Up\"><\/span><strong>1. Import Libraries and Set Up<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>First, we need to import the necessary libraries and set up the API configuration:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import pandas as pd\nimport datetime\nimport tejapi\nimport os\nimport numpy as np\n\n# Set TEJ API Key and Base URL\nos.environ&#91;'TEJAPI_KEY'] = \"your key\" \nos.environ&#91;'TEJAPI_BASE'] = \"https:\/\/api.tej.com.tw\"\n\n# Define Start and End Dates for Screening\nstart = '2024-01-01'\nend = '2025-01-01'\n\n# Import get_universe function\nfrom zipline.sources.TEJ_Api_Data import get_universe\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Nine_Stock_Pool_Screening_Examples_Using_get_universe\"><\/span><strong>2. Nine Stock Pool Screening Examples Using <\/strong><strong>get_universe<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Case_1_Retrieve_Securities_Previously_Listed_on_TWSE_General_Board_OTC_General_Board\"><\/span><a><\/a><strong>Case 1: Retrieve Securities Previously Listed on TWSE General Board &amp; OTC General Board<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>get_universe(start, end, mkt_bd_e=&#91;'TSE', 'OTC'])<\/strong><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Case_2_Retrieve_Securities_Previously_Listed_on_the_Taiwan_OTC_Market\"><\/span><a><\/a><strong>Case 2: Retrieve Securities Previously Listed on the Taiwan OTC Market<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>get_universe(start, end, mkt=&#91;'OTC'])<\/strong><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Case_3_Retrieve_Common_Stocks_Previously_Listed_on_TWSE_OTC\"><\/span><a><\/a><strong>Case 3: Retrieve Common Stocks Previously Listed on TWSE &amp; OTC<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>get_universe(start, end, mkt=&#91;'TWSE', 'OTC'], stktp_c=&#91;'\u666e\u901a\u80a1'])<\/strong>\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Case_4_Retrieve_Securities_Previously_Classified_as_%E2%80%9CM2324_%E5%8D%8A%E5%B0%8E%E9%AB%94%E6%A5%AD%E2%80%9D_Semiconductor_Industry\"><\/span><a><\/a><strong>Case 4: Retrieve Securities Previously Classified as &#8220;M2324 <\/strong><strong>\u534a\u5c0e\u9ad4\u696d<\/strong><strong>&#8221; (Semiconductor Industry)<\/strong><strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>get_universe(start, end, sub_ind_c=&#91;'M2324 \u534a\u5c0e\u9ad4\u696d'])<\/strong><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Case_5_Retrieve_Securities_Previously_Classified_as_%E2%80%9CM2324_Semiconductor%E2%80%9D_%E2%80%9CM2325_Computer_and_Peripheral_Equipment%E2%80%9D\"><\/span><a><\/a><strong>Case 5: Retrieve Securities Previously Classified as &#8220;M2324 Semiconductor&#8221; &amp; &#8220;M2325 Computer and Peripheral Equipment&#8221;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>get_universe(start, end, sub_ind_e=&#91;'M2324 Semiconductor',\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'M2325 Computer and Peripheral Equipment'])<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Case_6_Retrieve_Securities_of_Type_%E2%80%9CETF%E2%80%9D_and_%E2%80%9C%E6%99%AE%E9%80%9A%E8%82%A1%E2%80%9D_Common_Stocks_Listed_on_TWSE\"><\/span><a><\/a><strong>Case 6: Retrieve Securities of Type &#8220;ETF&#8221; and &#8220;<\/strong><strong>\u666e\u901a\u80a1<\/strong><strong>&#8221; (Common Stocks) Listed on TWSE<\/strong><strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>get_universe(start, end, stktp_c=&#91;'ETF', '\u666e\u901a\u80a1'], mkt=&#91;'TWSE'])<\/strong><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Case_7_Retrieve_Securities_Previously_Included_in_%E2%80%9CIX0002%E2%80%9D_Taiwan_50_Index\"><\/span><a><\/a><strong>Case 7: Retrieve Securities Previously Included in &#8220;IX0002&#8221; (Taiwan 50 Index)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>get_universe(start, end, idx_id='IX0002')<\/strong><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Case_8_Retrieve_Securities_Previously_in_the_%E2%80%9CM1100_%E6%B0%B4%E6%B3%A5%E5%B7%A5%E6%A5%AD%E2%80%9D_Cement_Industry_and_Part_of_%E2%80%9CIX0006%E2%80%9D_Taiwan_High_Dividend_Index\"><\/span><a><\/a><strong>Case 8: Retrieve Securities Previously in the &#8220;M1100 <\/strong><strong>\u6c34\u6ce5\u5de5\u696d<\/strong><strong>&#8221; (Cement Industry) and Part of &#8220;IX0006&#8221; (Taiwan High Dividend Index)<\/strong><strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>get_universe(start, end, main_ind_c='M1100 \u6c34\u6ce5\u5de5\u696d', idx_id='IX0006')<\/strong><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Case_9_Retrieve_Common_Stocks_in_Non-Financial_Industries\"><\/span><a><\/a><strong>Case 9: Retrieve Common Stocks in Non-Financial Industries<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>get_universe(start, end, main_ind_c=&#91;'\u4e00\u822c\u7522\u696d'], stktp_c='\u666e\u901a\u80a1')<\/strong><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TEJToolAPI\"><\/span><strong>TEJToolAPI<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>We now have a filtered target list after successfully creating a stock pool that meets our criteria. However, the stock pool is the starting point for investment data analysis. We need additional detailed financial data to perform in-depth analysis or strategy development.<\/strong><\/p>\n\n\n\n<p><strong>This is where TejToolAPI comes into play. With TejToolAPI, we can efficiently retrieve historical stock-related data, including financial information such as:<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;\u2705 Earnings per Share (EPS)<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;\u2705 Growth Rate<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;\u2705 Dividends<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;\u2705 Other key financial indicators<\/strong><\/p>\n\n\n\n<p><strong>By integrating TejToolAPI, we enhance the analytical value of every stock in our stock pool.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TejToolAPIget_history_data_Function\"><\/span><a><\/a><strong>TejToolAPI.get_history_data<\/strong><strong> Function<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>The <\/strong><strong>get_history_data function allows users to retrieve historical data related to securities and transactions. Below are its key parameters:<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_ticker_iterablestr\"><\/span><a><\/a><strong>1. <\/strong><strong>ticker<\/strong><strong> (iterable[str])<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose: Specifies the stock ticker(s) to query.<\/strong><\/li>\n\n\n\n<li><strong>Example: Supports multiple tickers, e.g., <\/strong><strong>[&#8220;2330&#8221;, &#8220;1101&#8221;, &#8220;3711&#8221;].<\/strong><\/li>\n\n\n\n<li><strong>Tip: You can combine it with <\/strong><strong>get_universe to dynamically select stocks.<\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_columns_iterablestr\"><\/span><a><\/a><strong>2. <\/strong><strong>columns<\/strong><strong> (iterable[str])<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose: Specifies the data fields to retrieve.<\/strong><\/li>\n\n\n\n<li><strong>Reference: The TEJ API documentation provides the list of available columns.<\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_transfer_to_chinese_boolean_default_False\"><\/span><a><\/a><strong>3. <\/strong><strong>transfer_to_chinese<\/strong><strong> (boolean, default: <\/strong><strong>False<\/strong><strong>)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose: Determines whether to translate column names into Chinese.<\/strong><\/li>\n\n\n\n<li><strong>Options:<\/strong><ul><li><strong>True<\/strong><strong> \u2192 Convert column names to Chinese<\/strong><\/li><\/ul>\n<ul class=\"wp-block-list\">\n<li><strong>False<\/strong><strong> \u2192 Keep column names in English<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_start_pdTimestamp_or_str\"><\/span><a><\/a><strong>4. <\/strong><strong>start<\/strong><strong> (pd.Timestamp or str)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose: Set the start date for data retrieval.<\/strong><\/li>\n\n\n\n<li><strong>Format: <\/strong><strong>&#8220;YYYY-MM-DD&#8221; or <\/strong><strong>pd.Timestamp(&#8220;YYYY-MM-DD&#8221;)<\/strong><\/li>\n\n\n\n<li><strong>Meaning: Returns data from the specified start date to the end date.<\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_end_pdTimestamp_or_str_optional_defaults_to_execution_date\"><\/span><a><\/a><strong>5. <\/strong><strong>end<\/strong><strong> (pd.Timestamp or str, optional, defaults to execution date)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose: Set the end date for data retrieval.<\/strong><\/li>\n\n\n\n<li><strong>Format: <\/strong><strong>&#8220;YYYY-MM-DD&#8221; or <\/strong><strong>pd.Timestamp(&#8220;YYYY-MM-DD&#8221;)<\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_fin_type_iterablestr\"><\/span><a><\/a><strong>6. <\/strong><strong>fin_type<\/strong><strong> (iterable[str])<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose: Specify the financial data type.<\/strong><\/li>\n\n\n\n<li><strong>Valid Options:<\/strong><ul><li><strong>&#8216;A&#8217;<\/strong><strong> \u2192 Cumulative Data<\/strong><\/li><\/ul><ul><li><strong>&#8216;F&#8217;<\/strong><strong> \u2192 Single Quarter Data<\/strong><\/li><\/ul>\n<ul class=\"wp-block-list\">\n<li><strong>&#8216;TTM&#8217;<\/strong><strong> \u2192 Trailing Twelve Months Data<\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Example: Supports multiple types, e.g., <\/strong><strong>[&#8220;A&#8221;, &#8220;TTM&#8221;].<\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_include_self_acc_str_default_%E2%80%98N\"><\/span><a><\/a><strong>7. <\/strong><strong>include_self_acc<\/strong><strong> (str, default: <\/strong><strong>&#8216;N&#8217;<\/strong><strong>)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose: Determines whether to include self-reported and board-approved financial data.<\/strong><\/li>\n\n\n\n<li><strong>Valid Options:<\/strong><ul><li><strong>&#8216;Y&#8217;<\/strong><strong> \u2192 Include self-reported and board-approved financial data.<\/strong><\/li><\/ul>\n<ul class=\"wp-block-list\">\n<li><strong>&#8216;N&#8217;<\/strong><strong> \u2192 Include only official investment financial data.<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_Retrieve_Historical_EPS_Data_for_Selected_Stocks\"><\/span><strong>Example: Retrieve Historical EPS Data for Selected Stocks<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>ticker = &#91;\"2330\", \"1101\", \"3711\"]  # Define Stock Codes\ncolumns = &#91;\"eps\"]  # Specify Data Fields\n\nTejToolAPI.get_history_data(\n    ticker = ticker,\n    columns = columns,\n    transfer_to_chinese = True,  # Convert column names to Chinese\n    start = pd.Timestamp(\"2021-07-02\"),  # Set Start Date\n    end = pd.Timestamp(\"2022-07-02\"),  # Set End Date\n    fin_type = &#91;\"A\", \"F\", \"TTM\"],  # Retrieve multiple financial data types\n    include_self_acc = \"Y\"  # Include self-reported data\n)\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>By combining <\/strong><strong>get_universe for stock screening and <\/strong><strong>TejToolAPI.get_history_data for retrieving financial metrics, we can automate the stock selection and data collection process. This enables efficient quantitative analysis and enhances investment decision-making.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full caption-align-center\"><img decoding=\"async\" width=\"947\" height=\"613\" src=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-655.png\" alt=\"TEJToolAPI\" class=\"wp-image-31975\" srcset=\"https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-655.png 947w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-655-300x194.png 300w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-655-150x97.png 150w, https:\/\/tejwin20260323.j.webweb.today\/wp-content\/uploads\/image-655-768x497.png 768w\" sizes=\"(max-width: 947px) 100vw, 947px\" \/><figcaption class=\"wp-element-caption\">data<\/figcaption><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"has-text-align-left\"><strong>Unlocking the Power of Data with TejToolAPI<\/strong><\/p>\n\n\n\n<p>With <strong>TejToolAPI<\/strong>, we can effortlessly and efficiently extract <strong>rich datasets<\/strong> from the <strong>TEJ database<\/strong>, including:<strong><\/strong><\/p>\n\n\n\n<p>&nbsp;\u2705 <strong>Financial indicators<\/strong><\/p>\n\n\n\n<p>&nbsp;\u2705 <strong>Growth rates<\/strong><\/p>\n\n\n\n<p>&nbsp;\u2705 <strong>Various multi-dimensional data<\/strong><\/p>\n\n\n\n<p>These datasets <strong>deepen our understanding<\/strong> of each stock in the stock pool and <strong>serve as a critical foundation<\/strong> for <strong>investment analysis and strategy design<\/strong>.<\/p>\n\n\n\n<p><strong>Important Reminder<\/strong>: This analysis is for reference only and does not constitute any product or investment advice.<\/p>\n\n\n\n<p>We welcome readers interested in various trading strategies to consider purchasing relevant solutions from&nbsp;<a href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/solution\/quantitative-finance-solution\/\" class=\"ek-link\"><strong><mark style=\"background-color:#ffdf88\" class=\"has-inline-color\">Quantitative Finance Solution<\/mark><\/strong><\/a>. With our high-quality databases, you can construct a trading strategy that suits your needs.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex 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:22px\"><a class=\"wp-block-button__link has-background wp-element-button\" href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/databank-solution\/financial-data\/\" style=\"border-radius:16px;background:linear-gradient(135deg,rgb(243,224,131) 0%,rgb(102,197,166) 50%,rgb(51,132,181) 100%)\"><strong>Access to Comprehensive Quantitative Data<\/strong><br><strong>Start Building Portfolios That Outperform the Market Today!<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<div style=\"height:22px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-text-align-center\" style=\"font-size:32px\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><strong><em>&#8220;Taiwan stock market data, TEJ collect it all.&#8221;<\/em><\/strong><\/mark><\/p>\n\n\n\n<p>The characteristics of the Taiwan stock market differ from those of other European and American markets. Especially in the first quarter of 2024, with the <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#c05d5d\" class=\"has-inline-color\">Taiwan Stock Exchange reaching a new high of 20,000 points<\/mark><\/strong> due to the rise in TSMC&#8217;s stock price, global institutional investors are paying more attention to the performance of the Taiwan stock market.&nbsp;<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0978b8\" class=\"has-inline-color\">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.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><mark style=\"background-color:#ebc766\" class=\"has-inline-color has-black-color\">Complete Coverage<\/mark><\/strong>: Includes all listed companies on stock markets in Taiwan, China, Hong Kong, Japan, Korea, etc.&nbsp;<\/li>\n\n\n\n<li><strong><mark style=\"background-color:#ebc766\" class=\"has-inline-color\">Comprehensive Analysis of Enterprises<\/mark><\/strong>: Operational aspects, financial aspects, securities market performance, ESG sustainability, etc.&nbsp;<\/li>\n\n\n\n<li><strong><mark style=\"background-color:#ebc766\" class=\"has-inline-color\">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.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>With TEJ&#8217;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!<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-a89b3969 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=\"https:\/\/tejwin20260323.j.webweb.today\/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 and Solutions?<br>Contact Us and Get the Free Trial Today!<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Use_TejToolAPI\"><\/span><a><\/a><strong>Why Use TejToolAPI?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\ud83d\udd39 <strong>Flexible parameter settings<\/strong> \u2013 Customize data queries to suit different investment needs.<\/p>\n\n\n\n<p>&nbsp;\ud83d\udd39 <strong>Comprehensive field selection<\/strong> \u2013 Extract precise financial and market data for analysis.<\/p>\n\n\n\n<p>&nbsp;\ud83d\udd39 <strong>Seamless integration<\/strong> \u2013 Quickly integrate retrieved data into the <strong>quantitative analysis process<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Next_Steps\"><\/span><a><\/a><strong>Next Steps<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Now that you have a <strong>basic understanding<\/strong> of retrieving the data you need using <strong>TejToolAPI<\/strong>, you can start incorporating these datasets into your investment workflow.<\/p>\n\n\n\n<p>For <strong>more advanced insights<\/strong>, check out the links below, where we provide deeper explanations and case studies on using <strong>TejToolAPI<\/strong> to refine your investment strategies.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"has-text-align-left\">&#8220;Welcome, investors, to refer to this. We will continue to introduce how to use the TEJ database to construct various indicators and backtest their performance. Therefore, we invite readers who are interested in trading backtests to explore <a href=\"https:\/\/tquant.tejwin.com\/\" target=\"_blank\" rel=\"noopener\">TQuant Lab<\/a>&#8216;s related plans, which allow you to build trading strategies that suit you using high-quality databases.<\/p>\n\n\n\n<p class=\"has-text-align-left\">A friendly reminder: This analysis is for reference only and does not constitute any advice on products or investments.&#8221;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%80%90TQuant_From_0_to_1_%E2%80%93_Day_3%E3%80%91Link_to_be_added\"><\/span><strong>\u3010TQuant: From 0 to 1 \u2013 Day 3\u3011(Link to be added)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-a89b3969 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=\"https:\/\/tejwin20260323.j.webweb.today\/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>Learn More About Our Databases and Solutions?<br>Contact Us and Get the Free Trial Today!<\/strong><\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Extended_Reading\"><\/span>Extended Reading<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/counter-indicator\/\">Counter-Indicator Analysis: Using TEJ API to Examine the Relationship Between Stock Prices and Counter-Indicators Issued By Authority<\/a><\/strong><\/li>\n\n\n\n<li><a href=\"https:\/\/tejwin20260323.j.webweb.today\/en\/insight\/stock-price-and-quarterly-reports\/\"><strong>Revenue Numbers Don&#8217;t Lie: How to Gain Insight into Stock Price Movements from Quarterly Reports<\/strong><\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Useful_Links\"><\/span><br>Useful Links<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/tejtw\/TQuant-Lab\" target=\"_blank\" rel=\"noopener\">TQuant Lab GitHub<\/a> <\/li>\n\n\n\n<li><a href=\"https:\/\/tquant.tejwin.com\" target=\"_blank\" rel=\"noopener\">TQuant Lab Official Website<\/a><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Preface In financial investment, mastering accurate and comprehensive data is an indispensable skill, and effectively managing stock pools and acquiring stock price data is the key to unlocking this skill. With the tools and APIs provided by TQuant Lab, we can easily define screening criteria, quickly establish stock pools that meet specific requirements, and retrieve [&hellip;]<\/p>\n","protected":false},"featured_media":33913,"template":"","tags":[2428],"insight-category":[50,1356],"class_list":["post-34042","insight","type-insight","status-publish","has-post-thumbnail","hentry","tag-2428","insight-category-fintech","insight-category-tquant-lab-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/insight\/34042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/insight"}],"about":[{"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/types\/insight"}],"version-history":[{"count":1,"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/insight\/34042\/revisions"}],"predecessor-version":[{"id":34043,"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/insight\/34042\/revisions\/34043"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/media\/33913"}],"wp:attachment":[{"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/media?parent=34042"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/tags?post=34042"},{"taxonomy":"insight-category","embeddable":true,"href":"https:\/\/tejwin20260323.j.webweb.today\/en\/wp-json\/wp\/v2\/insight-category?post=34042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}